Results 1 to 9 of 9

Thread: [RESOLVED] need help with filesys.copyfolder error handling

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2012
    Location
    St. Louis, MO
    Posts
    166

    Resolved [RESOLVED] need help with filesys.copyfolder error handling

    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
    Last edited by sheetzdw; Jun 18th, 2012 at 06:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width