Tell me more ×
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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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