Windows – How to get robocopy to use a log file which includes spaces

robocopywindows

I'm trying the following command:

robocopy "x:\dir" "y:\dir" /mir /z /tee /fft /nfl /ndl /eta /log:"x:\path to logs\12-15-11 01 file with spaces.txt"

I'm getting this error:

ERROR : Invalid Parameter #10 : "/log:x:\path to logs\12-15-11 01 file with spaces.txt"

EDIT #1

Turns out that the above command was valid, I had a typo in my path. If you have a path which includes spaces you can provide them to robocopy's /log switch like so: /log:"c:\path to a file\robocopy.log"

Best Answer

If you need to provide a path that includes spaces to robocopy's /log switch you can do it like this:

/log:"c:\path to logs files\some log file.txt"