Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
3  
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 –  ekaj 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
add comment

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
add comment

Your Answer

 
discard

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.