Issue #1304 has been updated by Borislav Stanimirov.


I am sorry that I mislead you. It turns out that the parameter needs to be in quoutations too (as if it's another file with a space in it)

my exact test case:

BackwardCopy.cmd:
@copy %2 %1

Test.rb:
system('"C:\\New Folder\\BackwardCopy.cmd" "C:\\New Folder\\target.txt" "C:\\New Folder\\source.txt"')

So I tested it some more and if the arguments have no quoutations it works ok. Here is an even simpler case that reproduces the bug:

Test.cmd:
echo %1 %2

Test.rb:
system('"C:/New Folder/test.cmd" "a" b') #=>'C:/New' is not recognized as an internal or external command,
operable program or batch file.
#system('"C:/New Folder/test.cmd" a b') works



----------------------------------------
http://redmine.ruby-lang.org/issues/show/1304

----------------------------------------
http://redmine.ruby-lang.org