Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

protected by Community Oct 11 '13 at 3:49

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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