Using RoboCopy it will also return a proper errorcode on exit.

I used this when we had to do a mass migration of HomeDrives from one server to another.

We found that error code 9 and 16 were the ones that we had to worry about the most. 0,1,2,3 were a success in one fashion or another.

here is how I used it.

 Code:
$Options = "/R:2 /Z /W:2 /CopyAll /MOV /E /V /NP /LOG+:\\serverx\c$\scripthome\logs\"+$AD_User+".txt"
Shell "%comspec% /c Robocopy " + $Directory + " " + "\\serverb\homedir$\" + Left($AD_User,1) + "\" +$AD_User+"\ "+ $Options
$results = @ERROR


Edited by Gargoyle (2008-09-06 01:40 AM)
Edit Reason: added code
_________________________
Today is the tomorrow you worried about yesterday.