Agent skill · Documentation

batch-files

Expert-level Windows batch file (.bat/.cmd) skill for writing, debugging, and maintaining CMD scripts. Use when asked to "create a batch file", "write a .bat script", "automate a Windows task", "CMD scripting", "batch automation", "scheduled task script", "Windows shell script", or when working with .bat/.cmd files in the workspace. Covers cmd.exe syntax, environment variables, control flow, string processing, error handling, and integration with system tools.

GitHub68,948★ · +463/wk · 2 repos on radarProfile →
copilotMIT
Install
npx skills add github/awesome-copilot --skill batch-files --agent copilot

Same command for any agent — swap --agent for claude-code, codex, cursor.

Facts
Files in the skill folder: 10
SKILL.md size: 17 KB
Bundled scripts: none
Path: skills/batch-files/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 37,432 · +281 this week
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Batch Files A comprehensive skill for creating, editing, debugging, and maintaining Windows batch files (.bat/.cmd) using cmd.exe. Applies to CLI tool development, system administration automation, scheduled tasks, file operations scripting, and PATH-based executable scripts. ## When to Use This Skill - Creating or editing `.bat` or `.cmd` files - Automating Windows tasks (file operations, deployments, backups) - Building CLI tools intended for a `bin/` folder on PATH - Writing scheduled task scripts (SCHTASKS, Task Scheduler) - Debugging batch script issues (variable expansion, error levels, quoting) - Integrating batch scripts with external tools (curl, git, Node.js, Python) - Scaffolding new batch-based projects with structured templates ## Prerequisites - Windows NT-based OS (Windows 7 or later) - cmd.exe (built-in) - Optional: a `bin/` directory on PATH for distributing scripts as commands - Optional: PATHEXT configured to include `.BAT;.CMD` (default on Windows) ## Command Interpretation cmd.exe processes each line through four stages in order: 1. **Variable substitution** — `%VAR%` tokens are replaced with environment variable values. `%0`–`%9` reference batch arguments. `

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Prerequisites
  3. Command Interpretation
  4. Variables
  5. Environment Variables
  6. Special Variables
  7. Scoping with SETLOCAL / ENDLOCAL
  8. Delayed Expansion
  9. Control Flow
  10. Conditional Execution
  11. Compound Commands
  12. FOR Loops
  13. GOTO and Labels
  14. Command-Line Arguments
Ships with 9 files
  • assets/executable.txt
  • assets/library.txt
  • assets/task.txt
  • references/batch-files-and-functions.md
  • references/cygwin.md
  • references/msys2.md
  • references/tools-and-resources.md
  • references/windows-commands.md
  • references/windows-subsystem-on-linux.md
More from awesome-copilot
All skills →
About this skill
What does the batch-files skill do?

Expert-level Windows batch file (.bat/.cmd) skill for writing, debugging, and maintaining CMD scripts. Use when asked to "create a batch file", "write a .bat script", "automate a Windows task", "CMD scripting", "batch automation", "scheduled task script", "Windows shell script", or when working with .bat/.cmd files in the workspace. Covers cmd.exe syntax, environment variables, control flow, string processing, error handling, and integration with system tools.

How do I install it?

Run `npx skills add github/awesome-copilot --skill batch-files --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From github/awesome-copilot, a repository with 37,432 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going