Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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"


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"

share|improve this question
Works for me. Does it perhaps show a more detailed error at the top? – Carko Dec 15 '11 at 22:01
Are you running that command in the context of a script instead of directly at the command line. Perhaps something else is adding some kind of escaping? – Zoredache Dec 15 '11 at 22:09
The error message suggests that the initial quote marks are before rather than after the colon; are you sure the command you were trying to run is as shown? – Harry Johnston Dec 16 '11 at 3:12
I so sorry, I had a typo in the path. Majorily embarrassed. Thanks for everyone's prompt help! What's the procedure, should I delete this question? Or can I rephrase it and add an answer showing that you can put quotes around the argument to /log switch of robocopy? – slm Dec 16 '11 at 15:25
No reason to delete @slm. If one of the above comments helped you find the problem, ask them to post it as an answer, and then mark the answer correct. If the issue was something else entirely, write your own answer and mark it as the answer so future searchers will know to check that if they have a similar problem. – music2myear Dec 16 '11 at 15:32

2 Answers 2

up vote 3 down vote accepted

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"
share|improve this answer
I get Invalid Error: parameter #11 "/log". I added it on to the end of an otherwise working command. – Andrew S Nov 14 at 5:39
I no longer work where I support windows so have no way to test this. – slm Nov 14 at 13:26

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.