Ihave a script that copies folders ok, but if any folder or file fails to copy it stops my script.
How can I add error handling to write a log if it cant write a file and give the reason then continue to the next file?
some thing like what I found below but I guess I need to break it down somehow because I want each file error to be written and only skip 1 file not a whole folder
Code:On Error Resume Next DoStep1 If Err.Number <> 0 Then WScript.Echo "Error in DoStep1: " & Err.Description Err.Clear End If DoStep2 If Err.Number <> 0 Then WScript.Echo "Error in DoStop2:" & Err.Description Err.Clear End If




Reply With Quote