Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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

protected by Community Oct 11 '13 at 3:49

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.