I am want to suppress all the errors that could appear in my VBS logon script.
Can I surround the WHOLE 500 lines script with :
On Error Resume Next
'[... whole script (~500 lines of code) ...]
On Error GoTo 0
I am want to suppress all the errors that could appear in my VBS logon script.
Can I surround the WHOLE 500 lines script with :
On Error Resume Next
'[... whole script (~500 lines of code) ...]
On Error GoTo 0
You can do it - even without the OEG0 line - but you shouldn't, because the script will continue to execute lines i ... last, even if an error in line i-1 invalidates all your assumptions about necessary pre-conditions of the actions in those lines. Your strategy is comparable to driving with your eyes shut to avoid being dazzled by the headlights of other cars.
If you can't do locally resticted error handling for selected actions -
try to get away with
This approach makes sure that the lines after an error won't be executed.