From: Logan Capaldo Date: 2006-03-08T07:32:17+09:00 Subject: Re: Running windows shell command On Mar 7, 2006, at 5:08 PM, dfaroi@gmail.com wrote: > Hi all, > > Sorry for my english, I'm french. > > I have some problem running an xcopy command with paths that contains > spaces. > I'm trying that : > output = `cmd /c xcopy /r /y \"C:/Test A\" \"C:/Test B\"` > > Xcopy doesn't return any error but don't transfer files from "Test A" > to "Test B". > If I rename those paths without spaces and double quotes, it works : > output = `cmd /c xcopy /r /y C:/TestA C:/Test B` > > Could someone can explain this issue ? > Or can tell me a better way to do fast copy files under Windows and > get > back a list of files tha was transfered ? > > Copying files with ruby is less faster than running an xcopy command. > Is it always true ? > > Thanks all for you're help to a french guy ;) > > David > > You may be 'over-escaping'. You shouldn't need to escape double- quotes in backticks. What happens if you do: output = `cmd /c xcopy /r /y "C:/Test A" "C:/Test B"`