Windows Command line: Is there any way to check syntax of bat file without actually running it?
Asked
Active
Viewed 2.1k times
3 Answers
4
Unfortunately a good and extensive checker doesn't really exist.
The only one I was able to locate is BatCodeCheck, which dates from 2014 and which checks for only a limited number of errors.
harrymc
- 498,455
1
Maybe you could try to run the .bat in a sandbox enironment. I haven't tried it myself, but start the cmd.exe in a sandbox programm and then try to execute the bat file.
This might work if all necessary files are present.
gxor
- 198
1
The obvious answer is yes, with the brain. Unfortunately for many of us, turns out to be not 100% reliable.
What might help is a few libraries mentioned in this thread:
- Library.bat with description here.
- JPSoft command debugging.
- Batch Compiler.
Laurie Stearn
- 540