Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

vbscript write error to log file

$
0
0

I know how to log some text I enter in a log file but I need to know how to log any ERROR in the vbscript to a log file.  The reason is I run a bunch of code as the system account and if it blows up I never get to see why or where.  The best I can do is put in standard text logs to say well I made it roughly to this point.

Is there any way to just say if you error (either instead of or at the same time) write the error code that is displayed when failing?  Like when it pops up the window Windows Script Host

Script:  xxxx

Line: xx

Char: x

Error: xxxxxxxxx

Code: xxxxxxx

Source: Microsoft VBScript runtime error

I'm not a pro at vbsripting at all and very much someone that just plays with the code until I figure it out and have little to no knowledge.

Anyone willing to help thank you very much.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>