Run Windows executable from R with command line options

I am trying to call a Windows program called AMDIS from R using a call

system("C:/NIST08/AMDIS32/AMDIS_32.exe /S C:/Users/Ento/Documents/GCMS/test_cataglyphis_iberica/queens/CI23_Q_120828_01.CDF")

to perform the analysis (indicated by the switch /S) in a file with a name CI23_Q_120828_01.CDF, but it seems that no matter what I try to do, the file is not loaded correctly, apparently because the parameters are not passed by. Does anyone know what I can do wrong?

Now this command is either

  • doing nothing,
  • makes AMDIS pop up, but it doesn’t load the file I specified.
  • gives me an error

    Warning message:

the executed command 'C: /NIST08/AMDIS32/AMDIS_32.exe/SC: /Users/Ento/Documents/GCMS/test_cataglyphis_iberica/queens/CI23_Q_120828_01.CDF "had the status 65535

( , )

( AMDIS 8)

Cheers,

EDIT:
, -

system("C:\\NIST08\\AMDIS32\\AMDIS_32.EXE C:\\Users\\Ento\\Documents\\GCMS\\test_cataglyphis_iberica\\queens\\CI23_Q_120828_01.CDF /S /E")

, - !

+5
1

bquote, noquote, sQuote, dQuote, quote enquote Quotes, shQuote!!!:-)

, . , , , shQuote . , ('sh' Unix, bash, csh C- 'cmd' Windows) wihtin shQuote, R :

shQuote("C:/NIST08/AMDIS32/AMDIS_32.exe /S C:/Users/Ento/Documents/GCMS/test_cataglyphis_iberica/queens/CI23_Q_120828_01.CDF" , type = "cmd" )
#[1] "\"C:/NIST08/AMDIS32/AMDIS_32.exe /S C:/Users/Ento/Documents/GCMS/test_cataglyphis_iberica/queens/CI23_Q_120828_01.CDF\""

shQuote :

system( shQuote( "mystring" , type = c("cmd","sh") ) , ... )
+7

All Articles