i use powershell + robocopy to copy files, and the format i use will return an error when it occurs; this ight help:
$SourceLocation = "D:\SQLBackups\";
$DestinationLocation = "\\gdc-bak-p01\SHARE\CRITICALBACKUPS\HOL\SQL-BACKUPS\HOL-SQL-CL01" ;
#/E copy directories even if empty
#/NFL no file logging in $CaptureOutput
#/NDL no directory logging in $CaptureOutput
#/NJH : No Job Header.
#/NJS : No Job Summary.
#/R:0 retry 0 times on failure
#getting robocopy to work and double quoting the paths was a bitch. hardcoding is easier.
$CaptureOutput = robocopy "D:\SQLBackups" "*.sqb" "\\gdc-bak-p01\SHARE\CRITICALBACKUPS\HOL\SQL-BACKUPS\HOL-SQL-CL01" /NFL /NDL /NJH /NJS /E /R:0 ;
#write-verbose -Message "param1 $CaptureOutput" -verbose;
#check if there was an error
$Isfailure = $CaptureOutput -match "ERROR ";
throw("Failure in copying $SourceLocation files to $DestinationLocation. Details: $CaptureOutput");
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!