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"
If you need to provide a path that includes spaces to robocopy's /log switch you can do it like this:
There are four way of logging as the Powershell documentation
/log:<LogFile>
: Writes the status output to the log file (overwrites the existing log file).robocopy "c:\a" "c:\b" /log:"c:\copy_log.log"
/log+:<LogFile>
: Writes the status output to the log file (appends the output to the existing log file).robocopy "c:\a" "c:\b" /log+:"c:\copy_log.log"
/unilog:<LogFile>
: Writes the status output to the log file as Unicode text (overwrites the existing log file).robocopy "c:\a" "c:\b" /unilog:"c:\copy_log.log"
/unilog+:<LogFile>
: Writes the status output to the log file as Unicode text (appends the output to the existing log file).robocopy "c:\a" "c:\b" /unilog+:"c:\copy_log.log"
For more details https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx
It happens when need admin privileges/ or pop to create file into that directory
So try to have a log/temp directory and try to add log file into that log directory
e.g:
If the path to the log file contains spaces or some other scripting delimiters, please include it in quotes such as your EDIT #1 and @slm suggests. But also, please note the use of escape characters as described in this documentation on Batch scripting.