Script stops on protected files such as system files

前端 未结 4 1924
轮回少年
轮回少年 2021-01-26 11:19

This code stops after a while due to protected files such as system files, \"Permission Denied\".

Is there a way to modify the code below so that it can handle such prot

4条回答
  •  时光说笑
    2021-01-26 12:00

    You can ignore script errors in VBScript by adding

    On Error Resume Next
    

    before the part of the code where you want to ignore errors.

    The statement to restore the default behavior is

    On Error GoTo 0
    

    And just a remark: Method calls in VB and VBScript don't use parenthesis if they appear as a single statement. So the line Go (objFolder) should be replaced by Go objFolder.

提交回复
热议问题