Skip to content

Shell command help

5 messages · galen kaufman, Richard M. Heiberger, Joshua Wiley +1 more

#
On Wed, Jun 2, 2010 at 9:40 PM, RICHARD M. HEIBERGER <rmh at temple.edu> wrote:
just wanted to add that I routinely use environment variables directly
for paths from the Windows command prompt.  shell() seems to be okay
with it too.  For example this should (confirmed on on Windows
versions 5.1.2600 and 6.1.7600) open the basic calculator:

shell("%WINDIR%/System32/calc.exe")

  
    
#
On 03.06.2010 04:19, galen kaufman wrote:
This cannot work. Is this all expected to be the first argument of 
shell()? If so, you need to quote it as a whole.
Since the above command cannot work, this error message is the resukt 
from another call you have not given.
Particularly the "c:\Program" points us to a problem with spaces in the 
directory "Program Files" but since you have not used that in your call 
from R, it must be something in C:\programx.exe or C:\inputx.inp that 
causes the problem, but it is not R related - unless you have used a 
completely different call.
These two lines are also from two different calls. I don't see the ">" 
from the first line is in the second line now....

So, *please* copy and paste only code and error messages that fit to 
each other!

Uwe Ligges
#
On 03.06.2010 06:40, RICHARD M. HEIBERGER wrote:
Rich,

actually, 8.3 names are not required if you use the quotes correctly, at 
least.
I would not discuss this there for educational purposes: Since correct 
quoting is sufficient and does not depend on the OS. Trying to be OS 
independent seems to be the better way in R, hence we should avoid 8.3 
names / %PROGRAMFILES% that other operating systems are not aware of.

Best wishes,
Uwe



 >