问题
I run a system command with spaces in directory name as followed:
command=paste(shQuote("java -jar C:/DIR A/DF.jar -t"), t1, t2)
I tried also:
command=paste('"java -jar C:/DIR A/DF.jar -t"', t1, t2)
However I get the following:
Error in system(command, intern = TRUE) :
'"java -jar C://DIR A/DF.jar -t"' not found
How can I handle space in directory name in Windows?
回答1:
Here is the solution
command=paste('java -jar "C:/DIR A/DF.jar" -t', t1, t2)
use " only for the dir name and the outside with '
来源:https://stackoverflow.com/questions/32541926/system-command-with-space-in-r