Shell Execution via cmd windows
This function is an extension to the
shell.exec() which is a native
function of R
shellexec.wcc(file, SW.cmd = 7L)
- a file name as in
- a SW_* command of showing windows
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.
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
SW_SHOWMINIMIZED (2): Activates the window and displays it as a
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.
- A new windows with certain applications depending on the association
of the input
Microsoft, Windows Dev Center: Windows desktop applications > Develop > Desktop technologies > Desktop Environment > The Windows Shell > Shell Reference > Shell Functions > ShellExecute
library(pbdZMQ, quietly = TRUE) shellexec.wcc("a.txt", 5L)