I have a script in VBScript. I'm not sure if it contains any syntax errors or other non-runtime errors. Normally I would just run the script, but I don't want the script to actually run because the changes it makes are hard to reverse correctly.

Is it possible to make W/CScript check for syntax errors but not run the script if none were found?

I didn't know if this was better suited for SO but I thought it was more WScript specific, as my question lies with WSCript and not the script itself.

1 Answer 1


For those that like to know how I worked around this:

The majority of the script were subs and functions, with only a few lines of code that were executed on startup. I moved those lines into a Sub Main, and places a line to call Main on the first line.

If I needed to check for syntax errors, I could comment the line that calls Sub Main so no code would be executed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .