| 1. |
Solve : Variables with embedded blanks? |
|
Answer» I have a batch file using ROBOCOPY to copy FILES and folders from my C: drive to my shared network drive S:. It works fine when the folder names do not have blank spaces. %"folder"% I expect you've realised why that won't work... I hit a snag when I tried to add a log switch. It failed both inside and outside of the quotes. The //MIR switch worked OK outside of the quotes Both of these failed: Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder%" /Log:backup.txt Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder% /Log:backup.txt" Quote from: FrankGC on August 10, 2009, 02:48:24 PM I hit a snag when I tried to add a log switch.I don't see any reason why there is a problem with the first one, but the SECOND one definatly has major flaws. Thanks to all I made the beginners error of copy and paste into the command line in my .bat file. Who knows what extraneous characters accompanied the /log switch. When I typed it it it worked fine. Robocopy "c:\Users\Owner\Music\Recordings\%folder%" "s:\Shared-Music\%folder%" /log:MusicBkupLog.txt Frank C |
|