Skip to content

system/system2 command

5 messages · Jeff Breiwick, Gabor Grothendieck, Duncan Murdoch

#
All,

I had a simple function call I used to open up a dos shell running R under 
Win XP:
system("cmd.exe", wait=FALSE, invisible=FALSE).

This does not work with R 2.12.1 - I get a window that briefly flashes open 
but then disappears. Does anyone know the method to open a DOS command 
window in running R with Win XP? Thank you.

Jeff Breiwick
#
On Fri, Dec 17, 2010 at 4:36 PM, Jeff Breiwick <jeff.breiwick at noaa.gov> wrote:
This works on my Vista system:

shell("start cmd")
#
Gabor Grothendieck wrote:
Is start back in Vista?  There was a start.exe in Windows95, but I think 
it disappeared in XP and I had to write my own. (Or maybe it became an 
internal command?) Brian Ripley added a similar program "open.exe" 
(based on the OSX name, I think) to R, so if "start cmd" fails, "open 
cmd" might succeed.

Duncan Murdoch
#
On Sat, Dec 18, 2010 at 8:07 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
Yes its in Vista and its at least in XP Pro according to:
   http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx

Note that its internal to cmd so if you are using some other command
line shell then you will need to do:
   cmd /c start
1 day later
#
On 17/12/2010 4:36 PM, Jeff Breiwick wrote:
This is a new bug in 2.12.1, which I am about to fix in R-patched.  The 
problem was that it was passing a null input stream to cmd.exe, which 
saw an immediate EOF, and quit.  A similar thing happened in Rterm, 
where system("cmd") should drop into a command shell in the same window, 
but it would immediately exit.

Duncan Murdoch