shellexec.wcc {pbdZMQ} | R Documentation

## Shell Execution via cmd windows

### Description

This function is an extension to the `shell.exec`() which is a native function of R

### Usage

    shellexec.wcc(file, SW.cmd = 7L)

### Arguments

`file` | a file name as in `shell.exec`()
`SW.cmd` | a SW_* command of showing windows

### Details

`shell.exec("a.txt")` will open a windows (notepad) to edit the file `a.txt` in windows system. However, the notepad will block the (parent) active R windows, i.e. `SW.cmd = 5` as `SH_SHOW` by default.

The `shellexec.wcc("a.txt", SW.cmd = 7L)` will open the notepad, but in a minimized window. Therefore, there is no blocking to the active R windows. See the website in the references section to see more options to control the behavior of new windows. Possible choices are

`SW_SHOW (5)`: Activates the window and displays it in its current size and position.

`SW_SHOWMINIMIZED (2)`: Activates the window and displays it as a minimized window.

`SW_SHOWMINNOACTIVE (7)`: Displays the window as a minimized window. The active window remains active.

`SW_SHOWNA (8)`: Displays the window in its current state. The active window remains active.

### Value

A new windows with certain applications depending on the association of the input `file`.

### Author(s)

Wei-Chen Chen wccsnow@gmail.com.

### References

Microsoft, Windows Dev Center: Windows desktop applications > Develop > Desktop technologies > Desktop Environment > The Windows Shell > Shell Reference > Shell Functions > ShellExecute

`https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx`

### See Also

`shell.exec()`.

### Examples

    ## Not run:
    library(pbdZMQ, quietly = TRUE)

    shellexec.wcc("a.txt", 5L)

    ## End(Not run)

[Package pbdZMQ version 0.2-6 Index]