Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Robocopy OK on command line, errors when in batch file

Status
Not open for further replies.

fredmartinmaine

IS-IT--Management
Mar 23, 2015
79
0
0
US
This robocopy command:

robocopy "H:" "T:\My Drive" /E /XD "*$RECYCLE.BIN*" /XF "*thumbs.db*" /V /LOG:"H:\robocopy.txt"

Works fine from a DOS command line, but in a batch file that's run from the command line, produces this:

Source - I:\IT Files\Projects\My Drive\ H:\MX T:\My Drive Dest - I:\E \XD

The I: drive and path are the current directory. I don't know why it's added those, and I don't know what's generating the   characters. But, it calls them out as invalid parameters and prevents robocopy from running.

Is there some special syntax needed for running from a batch file?

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top