Repository navigation
Debug-CMD v1.0.0-beta.1
Pre-release
Pre-release
Debug-CMD v1.0.0
Drag a .cmd or .bat file onto Debug-CMD.cmd and get a timestamped log of everything it did, plus a summary of what worked and what failed. One file, nothing to install: it uses the PowerShell that already ships with Windows 10/11.
Highlights
- Safe test mode: choose
Tto only analyze a script. Nothing is executed. It flags dangerous commands (delete, format, registry, shutdown, downloads...) and brokengoto/calltargets. - Command-by-command debugging: runs a temporary copy of your script with
echo on, so the log shows each command before its output. Your original is never modified. - Easy-to-read HTML report: a self-contained page (works offline, light/dark theme) with a status badge, summary cards, expandable failed commands, a list of what worked, and a filterable full log.
- Timestamped
.log: every line has a time with milliseconds, with a summary at the top. - Hands-off:
pausecommands in the copy are skipped so the script runs to the end. - Robust: on Ctrl+C the log and report are still saved, the process is stopped, and the temporary copy is deleted.
- Not frozen: during long, silent commands it prints "running for mm:ss" every 10 seconds.
Usage
- Download
Debug-CMD.cmd(below). - Drag your
.cmdor.batonto it. - Choose E to execute and debug, or T to test only.
Options
Edit the top of Debug-CMD.cmd: ELEVATE, ECHO_ON, SKIP_PAUSE, OPEN_REPORT, GENERATE_HTML and MODE (ASK, RUN or TEST). See the README for details.
Known limitations
- Errors are detected by keywords in the output (English and Portuguese), so some may be missed and some false positives are possible.
- Test mode is a static keyword scan: it does not expand variables or follow scripts it calls. It lowers risk, it does not guarantee safety.
- Commands using
>nul 2>&1hide their own errors. - Only the dragged script is forced to
echo on; scripts it launches withcallkeep their ownecho off. - Debug mode really runs your script. Use test mode first if you are unsure.
Requirements
Windows 10 or 11 with Windows PowerShell 5.1 (included).
Feedback
Tested so far on Windows 10 Pro. Please open an issue if something breaks or a command is misclassified.