Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Win 2003 I execute command

"C:\Program Files\Windows Resource Kits\Tools\robocopy" "q:\SQLBackup" "\\SQLBackups\MyDB"  /Z /S /MIR 

I am getting an error:

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

What could I do? I don't want to add C:\Program Files\Windows Resource Kits\Tools\ to a PATH environment variable.

share|improve this question
Then every time set the path manually by set path command in shell command. – avirk Apr 8 '12 at 0:25
How are you executing that command? Because it should work as written. – Harry Johnston Apr 19 '12 at 6:09
up vote 2 down vote accepted

You don't need to give the path of ROBOCOPY as part of the command. Your syntax is off a little. Change your code to

robocopy q:\SQLBackup \\SQLBackups\MyDB /Z /S /MIR

share|improve this answer
Change the directory first to C:\Program Files\Windows Resource Kits\Tools\ by using `cd C:\Program Files\Windows Resource Kits\Tools`... and then use @CharlieRB's answer – cutrightjm Apr 8 '12 at 0:17
Robocopy is not installed by default on Windows Server 2003. It needs to be added with the Windows Server 2003 Resource Kit, and it appears that the path is not added automatically on installation. – paradroid Apr 8 '12 at 1:10

If you do not want to add the directory to your path, the simplest option would be to copy robocopy.exe to %WINDIR%\system32. Alternatively, you could make a hardlink pointing to it.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .