Topics
- batch
- windows
- cmd
- shell-scripting
- automation
- scheduled-tasks
- cli-tools
- system-administration
- error-handling
- file-operations
What it does
Writes, debugs, and maintains Windows batch files (.bat/.cmd) using cmd.exe syntax, control flow, error handling, and integration with system tools. Covers variable scoping, FOR loops, argument parsing, string manipulation, arithmetic, and file/network/system commands for CLI tool development, task automation, and scheduled scripts on Windows NT systems.
Generated from the current SKILL.md.
Frequently asked
Does this skill cover PowerShell or only cmd.exe?
This skill is for cmd.exe batch files (.bat/.cmd) only. It does not cover PowerShell scripting.
Can I use this skill to write scripts for non-Windows systems?
No. This skill is Windows-specific and requires Windows NT-based OS (Windows 7 or later) with cmd.exe.
What should I use for string parsing and regex?
The skill covers FINDSTR (limited regex), substring syntax (%VAR:~start,length%), and FOR /F loops for parsing command output and files. Full regex support is not available in batch.
How do I handle errors in batch scripts?
Check %ERRORLEVEL% after commands, use && and || for conditional execution, or combine error checks with compound commands and parenthesized blocks.
Can I create reusable functions in batch files?
Yes. Use CALL :label to invoke functions, SETLOCAL/ENDLOCAL for variable scoping, and the endlocal & set pattern to return values from scoped blocks.
Generated from the current SKILL.md. These answers refresh after source changes.