Using Robocopy with PDQ Deploy

4/26/2018 420 Contributors

Robocopy is a fantastic copy utility that I have used for years. There is one small gotcha when using Robocopy, however. The "gotcha" has to do with Exit Codes (AKA Error Codes, AKA Return Codes).

Exit Code 0 is, for the most part, the code that most processes, applications and installers use when NO errors were encountered. A non-zero exit code generally means that there was a problem encountered somewhere.

For Robocopy, Exit Code 0 means that there were NO errors and that NO files were copied. (this way you know that if there were any new files to be copied that they would have been but the source and target directories are already synchronized). 

Exit Code 1 means that one or more files copied SUCCESSFULLY! This means that you need to define the exit code 1 to your list of Successful Return Codes.

RobocopyReturnCode.png

 

Here is a site containing the Exit Codes for Robocopy.

Keep in mind that Error 16 usually means that there is a permissions error on either the Target or Source directories. Make sure that the credentials you are using with PDQ Deploy have the appropriate rights on both the target computer (must have administrative rights) and the source directory (must be able to see, access and copy from source). You can see the credentials you are using in the Deploy Now window. In the example below, the use account GConstanza in the Vandalay domain must be an Administrator of the all the target machines AND must be able to see and copy files from the \\Scranton\e$\deploy\OpenZone directory. (source directory referenced in image above)

1.4DeployCredentials.png