bat
1 TopicRobocopy doesn't work with folders given as arguments.
Hi! I'm writing a .bat script to copy exactly one file between two harddrives. First I write this: SET A1=%1 <source> SET A2=%2 <destination> SET A3=%3 <file> This works: (folders are hard-coded) ROBOCOPY C:\test\ "D:\Folder with spaces\" %A3% This does not work: (all arguments) ROBOCOPY %A1% %A2% %A3% When it fails, it can be of several reasons: Robocopy cannot find the file. Robocopy messes up on the folders, so the <source> ends at the first space in <destination> The following tweaks does not either work: Replacing SET A1=%1 with SET A1="%~1" , (along with the rest of the arguments) Omitting spaces, so %A1% %A2% %A3% becomes %A1%%A2%%A3% . Do you have any suggestions to what I can do to get Robocopy to work with all the arguments, with no hard-coding?1.2KViews0likes2Comments