{"id":"583b40ba-8511-4c08-8f4a-40b929fe0006","shortId":"Rg6fth","kind":"skill","title":"batch-files","tagline":"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\", ","description":"# Batch Files\n\nA 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.\n\n## When to Use This Skill\n\n- Creating or editing `.bat` or `.cmd` files\n- Automating Windows tasks (file operations, deployments, backups)\n- Building CLI tools intended for a `bin/` folder on PATH\n- Writing scheduled task scripts (SCHTASKS, Task Scheduler)\n- Debugging batch script issues (variable expansion, error levels, quoting)\n- Integrating batch scripts with external tools (curl, git, Node.js, Python)\n- Scaffolding new batch-based projects with structured templates\n\n## Prerequisites\n\n- Windows NT-based OS (Windows 7 or later)\n- cmd.exe (built-in)\n- Optional: a `bin/` directory on PATH for distributing scripts as commands\n- Optional: PATHEXT configured to include `.BAT;.CMD` (default on Windows)\n\n## Command Interpretation\n\ncmd.exe processes each line through four stages in order:\n\n1. **Variable substitution** — `%VAR%` tokens are replaced with environment variable values. `%0`–`%9` reference batch arguments. `%*` expands to all arguments.\n2. **Quoting and escaping** — Caret `^` escapes special characters (`& | < > ^`). Quotation marks prevent interpretation of enclosed special characters. In batch files, `%%` yields a literal `%`.\n3. **Syntax parsing** — Lines are split into pipelines (`|`), compound commands (`&`, `&&`, `||`), and parenthesized groups `( )`.\n4. **Redirection** — `>` overwrites, `>>` appends, `<` reads input, `2>` redirects stderr, `2>&1` merges stderr into stdout, `>NUL` discards output.\n\n## Variables\n\n### Environment Variables\n\n```bat\nset _MY_VAR=Hello World\necho %_MY_VAR%\nset _MY_VAR=\n```\n\n- `set` with no arguments lists all variables\n- `set _PREFIX` lists variables starting with `_PREFIX`\n- No spaces around `=` — `set name = val` sets variable `\"name \"` to `\" val\"`\n\n### Special Variables\n\n| Variable | Value |\n|----------|-------|\n| `%CD%` | Current directory |\n| `%DATE%` | System date (locale-dependent) |\n| `%TIME%` | System time HH:MM:SS.mm |\n| `%RANDOM%` | Pseudorandom number 0–32767 |\n| `%ERRORLEVEL%` | Exit code of last command |\n| `%USERNAME%` | Current user name |\n| `%USERPROFILE%` | Current user profile path |\n| `%TEMP%` / `%TMP%` | Temporary file directory |\n| `%PATHEXT%` | Executable extensions list |\n| `%COMSPEC%` | Path to cmd.exe |\n\n### Scoping with SETLOCAL / ENDLOCAL\n\n```bat\nsetlocal\nset _LOCAL_VAR=scoped value\nendlocal\nREM _LOCAL_VAR is no longer defined here\n```\n\nTo return a value from a scoped block:\n\n```bat\nendlocal & set _RESULT=%_LOCAL_VAR%\n```\n\n### Delayed Expansion\n\nVariables inside parenthesized blocks are expanded at parse time. Use delayed expansion for runtime evaluation:\n\n```bat\nsetlocal EnableDelayedExpansion\nset _COUNT=0\nfor /l %%i in (1,1,5) do (\n    set /a _COUNT+=1\n    echo !_COUNT!\n)\nendlocal\n```\n\n- `!VAR!` expands at execution time (delayed)\n- `%VAR%` expands at parse time (immediate)\n\n## Control Flow\n\n### Conditional Execution\n\n```bat\nif exist \"output.txt\" echo File found\nif not defined _MY_VAR echo Variable not set\nif \"%_STATUS%\"==\"ready\" (echo Go) else (echo Wait)\nif %ERRORLEVEL% neq 0 echo Command failed\n```\n\nComparison operators: `equ`, `neq`, `lss`, `leq`, `gtr`, `geq`. Use `/i` for case-insensitive string comparison.\n\n### Compound Commands\n\n```bat\ncommand1 & command2        & REM Always run both\ncommand1 && command2       & REM Run command2 only if command1 succeeds\ncommand1 || command2       & REM Run command2 only if command1 fails\n```\n\n### FOR Loops\n\n```bat\nREM Iterate over a set of values\nfor %%i in (alpha beta gamma) do echo %%i\n\nREM Numeric range: start, step, end\nfor /l %%i in (1,1,10) do echo %%i\n\nREM Files in a directory\nfor %%f in (*.txt) do echo %%f\n\nREM Recursive file search\nfor /r %%f in (*.log) do echo %%f\n\nREM Directories only\nfor /d %%d in (*) do echo %%d\n\nREM Parse command output\nfor /f \"tokens=1,2 delims=:\" %%a in ('ipconfig ^| findstr \"IPv4\"') do echo %%b\n\nREM Parse file lines\nfor /f \"usebackq tokens=*\" %%a in (\"data.txt\") do echo %%a\n```\n\n### GOTO and Labels\n\n```bat\ngoto :main_logic\n:usage\necho Usage: %~nx0 [options]\nexit /b 1\n\n:main_logic\necho Running main logic...\ngoto :eof\n```\n\n`goto :eof` exits the current batch or subroutine. Labels start with `:`.\n\n## Command-Line Arguments\n\n| Syntax | Value |\n|--------|-------|\n| `%0` | Script name as invoked |\n| `%1`–`%9` | Positional arguments |\n| `%*` | All arguments (unaffected by SHIFT) |\n| `%~1` | Argument 1 with enclosing quotes removed |\n| `%~f1` | Full path of argument 1 |\n| `%~d1` | Drive letter of argument 1 |\n| `%~p1` | Path (without drive) of argument 1 |\n| `%~n1` | File name (no extension) of argument 1 |\n| `%~x1` | Extension of argument 1 |\n| `%~dp0` | Drive and path of the batch file itself |\n| `%~nx0` | File name with extension of the batch file |\n| `%~z1` | File size of argument 1 |\n| `%~$PATH:1` | Search PATH for argument 1 |\n\n### Argument Parsing Pattern\n\n```bat\n:parse_args\nif \"%~1\"==\"\" goto :args_done\nif /i \"%~1\"==\"--help\" goto :usage\nif /i \"%~1\"==\"--output\" (\n    set \"_OUTPUT_DIR=%~2\"\n    shift\n)\nshift\ngoto :parse_args\n:args_done\n```\n\n## String Processing\n\n### Substrings\n\n```bat\nset _STR=Hello World\necho %_STR:~0,5%       & REM \"Hello\"\necho %_STR:~6%         & REM \"World\"\necho %_STR:~-5%        & REM \"World\"\necho %_STR:~0,-6%      & REM \"Hello\"\n```\n\n### Search and Replace\n\n```bat\nset _STR=Hello World\necho %_STR:World=Earth%       & REM \"Hello Earth\"\necho %_STR:Hello=%            & REM \" World\" (remove \"Hello\")\n```\n\n### Substring Containment Test\n\n```bat\nif not \"%_STR:World=%\"==\"%_STR%\" echo Contains \"World\"\n```\n\n## Functions\n\nFunctions use labels, CALL, and SETLOCAL/ENDLOCAL:\n\n```bat\n@echo off\ncall :greet \"Jane Doe\"\necho Result: %_GREETING%\nexit /b 0\n\n:greet\nsetlocal\nset \"_MSG=Hello, %~1\"\nendlocal & set \"_GREETING=%_MSG%\"\nexit /b 0\n```\n\n- `call :label args` invokes a function\n- `exit /b` returns from the function (not the script)\n- Use the `endlocal & set` trick to pass values out of a scoped block\n\n## Arithmetic\n\n`set /a` performs 32-bit signed integer arithmetic:\n\n```bat\nset /a _RESULT=10 * 5 + 3\nset /a _COUNTER+=1\nset /a _REMAINDER=14 %% 3       & REM Use %% for modulo in batch files\nset /a _BITS=\"255 & 0x0F\"       & REM Bitwise AND\n```\n\nSupported operators: `+ - * / %% ( )` and bitwise `& | ^ ~ << >>`.\n\nHexadecimal (`0xFF`) and octal (`077`) literals are supported.\n\n## Error Handling\n\n### Error Level Conventions\n\n- `0` = success\n- Non-zero = failure (typically `1`)\n\n```bat\nmycommand.exe\nif %ERRORLEVEL% neq 0 (\n    echo ERROR: mycommand failed with code %ERRORLEVEL%\n    exit /b %ERRORLEVEL%\n)\n```\n\n### Fail-Fast Pattern\n\n```bat\ncommand1 || (echo command1 failed & exit /b 1)\ncommand2 || (echo command2 failed & exit /b 1)\n```\n\n### Setting Exit Codes\n\n```bat\nexit /b 0        & REM Return success from a batch/function\nexit /b 1        & REM Return failure\ncmd /c \"exit /b 42\"   & REM Set ERRORLEVEL to 42 inline\n```\n\n## Essential Commands Reference\n\n### File Operations\n\n| Command | Purpose |\n|---------|---------|\n| `DIR` | List directory contents |\n| `COPY` | Copy files |\n| `XCOPY` | Extended copy with subdirectories (legacy) |\n| `ROBOCOPY` | Robust copy with retry, mirror, logging |\n| `MOVE` | Move or rename files |\n| `DEL` | Delete files |\n| `REN` | Rename files |\n| `MD` / `MKDIR` | Create directories |\n| `RD` / `RMDIR` | Remove directories |\n| `MKLINK` | Create symbolic or hard links |\n| `ATTRIB` | View or set file attributes |\n| `TYPE` | Print file contents |\n| `MORE` | Paginated file display |\n| `TREE` | Display directory structure |\n| `REPLACE` | Replace files in destination with source |\n| `COMPACT` | Show or set NTFS compression |\n| `EXPAND` | Extract from .cab files |\n| `MAKECAB` | Create .cab archives |\n| `TAR` | Create or extract tar archives |\n\n### Text Search and Processing\n\n| Command | Purpose |\n|---------|---------|\n| `FIND` | Search for literal strings |\n| `FINDSTR` | Search with limited regular expressions |\n| `SORT` | Sort lines alphabetically |\n| `CLIP` | Copy piped input to clipboard |\n| `FC` | Compare two files |\n| `COMP` | Binary file comparison |\n| `CERTUTIL` | Encode/decode Base64, compute hashes |\n\n### System Information\n\n| Command | Purpose |\n|---------|---------|\n| `SYSTEMINFO` | Full system configuration |\n| `HOSTNAME` | Display computer name |\n| `VER` | Windows version |\n| `WHOAMI` | Current user and group info |\n| `TASKLIST` | List running processes |\n| `TASKKILL` | Terminate processes |\n| `WMIC` | WMI queries (drives, OS, memory) |\n| `SC` | Service control (query, start, stop) |\n| `DRIVERQUERY` | List installed drivers |\n| `REG` | Registry operations (query, add, delete) |\n| `SETX` | Set persistent environment variables |\n\n### Network\n\n| Command | Purpose |\n|---------|---------|\n| `PING` | Test network connectivity |\n| `IPCONFIG` | IP configuration |\n| `NSLOOKUP` | DNS lookup |\n| `NETSTAT` | Network connections and ports |\n| `TRACERT` | Trace route to host |\n| `NET USE` | Map/disconnect network drives |\n| `NET USER` | Manage user accounts |\n| `NETSH` | Network configuration utility |\n| `ARP` | ARP cache management |\n| `ROUTE` | Routing table management |\n| `CURL` | HTTP requests (Windows 10+) |\n| `SSH` | Secure shell (Windows 10+) |\n\n### Scheduling and Automation\n\n| Command | Purpose |\n|---------|---------|\n| `SCHTASKS` | Create and manage scheduled tasks |\n| `TIMEOUT` | Wait N seconds (Vista+) |\n| `START` | Launch programs asynchronously |\n| `RUNAS` | Run as different user |\n| `SHUTDOWN` | Shutdown or restart |\n| `FORFILES` | Find files by date and execute commands |\n\n### Shell Utilities\n\n| Command | Purpose |\n|---------|---------|\n| `WHERE` | Locate executables in PATH |\n| `DOSKEY` | Create command macros |\n| `CHOICE` | Prompt for single-key input |\n| `MODE` | Configure console size and ports |\n| `SUBST` | Map folder to drive letter |\n| `CHCP` | Get or set console code page |\n| `COLOR` | Set console colors |\n| `TITLE` | Set console window title |\n| `ASSOC` / `FTYPE` | File type associations |\n\n## Shell Syntax and Expressions\n\n### Parentheses for Grouping\n\nParentheses turn compound commands into a single unit for redirection or conditional execution:\n\n```bat\n(echo Line 1 & echo Line 2) > output.txt\nif exist \"data.csv\" (\n    echo Processing...\n    call :process \"data.csv\"\n) else (\n    echo No data found.\n)\n```\n\n### Escape Characters\n\nThe caret `^` escapes the next character:\n\n```bat\necho Total ^& Summary          & REM Outputs: Total & Summary\necho 100%% complete            & REM Outputs: 100% complete (in batch)\necho Line one^\nLine two                       & REM Caret escapes the newline\n```\n\nAfter a pipe, triple caret is needed: `echo x ^^^& y | findstr x`\n\n### Wildcards\n\n- `*` matches any sequence of characters\n- `?` matches a single character (or zero at end of period-free segment)\n\n```bat\ndir *.txt           & REM All .txt files\nren *.jpeg *.jpg    & REM Bulk rename\n```\n\n### Redirection Summary\n\n```bat\ncommand > file.txt          & REM Overwrite stdout to file\ncommand >> file.txt         & REM Append stdout to file\ncommand 2> errors.log       & REM Redirect stderr\ncommand > all.log 2>&1      & REM Merge stderr into stdout\ncommand < input.txt         & REM Read stdin from file\ncommand > NUL 2>&1          & REM Discard all output\n```\n\n## Writing Production-Quality Batch Files\n\n### Standard Script Structure\n\n```bat\n@echo off\nsetlocal EnableDelayedExpansion\n\nREM ============================================================\nREM  Script: example.bat\nREM  Purpose: Describe what this script does\nREM ============================================================\n\ncall :main %*\nexit /b %ERRORLEVEL%\n\n:main\n    call :parse_args %*\n    if not defined _TARGET (\n        echo ERROR: --target is required. 1>&2\n        call :usage\n        exit /b 1\n    )\n    echo Processing: %_TARGET%\n    exit /b 0\n\n:parse_args\n    if \"%~1\"==\"\" exit /b 0\n    if /i \"%~1\"==\"--target\" set \"_TARGET=%~2\" & shift\n    if /i \"%~1\"==\"--help\"   call :usage & exit /b 0\n    shift\n    goto :parse_args\n\n:usage\n    echo Usage: %~nx0 --target ^<path^> [--help]\n    echo.\n    echo Options:\n    echo   --target   Path to process (required)\n    echo   --help     Show this help message\n    exit /b 0\n```\n\n### Best Practices\n\n1. **Always start with `@echo off` and `setlocal`** — Prevents noisy output and variable leakage to the caller.\n2. **Validate inputs before processing** — Check required arguments and file existence early. Use `if not defined` and `if not exist`.\n3. **Quote paths and variables** — Use `\"%~1\"` and `\"%_MY_PATH%\"` to handle spaces and special characters safely.\n4. **Use `exit /b` instead of `exit`** — Avoids closing the parent console window.\n5. **Return meaningful exit codes** — `exit /b 0` for success, non-zero for specific failures.\n6. **Use `%~dp0` for script-relative paths** — Ensures the script works regardless of the caller's working directory.\n7. **Prefer `ROBOCOPY` over `XCOPY`** — More reliable, supports retry, mirroring, and logging.\n8. **Use `EnableDelayedExpansion` when modifying variables inside loops or parenthesized blocks.**\n9. **Write errors to stderr** — `echo ERROR: message 1>&2` keeps stdout clean for piping.\n10. **Use `REM` for comments** — `::` can cause issues inside `FOR` loop bodies.\n\n### Security Considerations\n\n- **Never store credentials in batch files** — Use environment variables, credential stores, or prompts.\n- **Validate user input** — Unquoted variables containing `&`, `|`, or `>` can inject commands. Always quote: `\"%_USER_INPUT%\"`.\n- **Use `SETLOCAL`** — Prevents variable values from leaking to parent processes.\n- **Sanitize file paths** — Validate paths before passing to `DEL`, `RD`, or `ROBOCOPY` to prevent unintended deletion.\n- **Avoid `SET /P` for sensitive input** — Input is visible and stored in console history. Use a dedicated credential tool when possible.\n\n## Debugging and Troubleshooting\n\n| Technique | How |\n|-----------|-----|\n| Trace execution | Remove `@echo off` or use `@echo on` temporarily |\n| Step through | Add `PAUSE` between sections |\n| Check error level | `echo Exit code: %ERRORLEVEL%` after each command |\n| Inspect variables | `set _MY_` to list all variables starting with `_MY_` |\n| Delayed expansion issues | Variable inside `( )` block not updating? Enable `!VAR!` syntax |\n| FOR loop `%%` vs `%` | Use `%%i` in batch files, `%i` on the command line |\n| Spaces in SET | `set name=value` not `set name = value` |\n| Caret in pipes | After a pipe, use `^^^` to escape special chars |\n| Parentheses in SET /A | Escape with `^(` and `^)` inside `if` blocks, or use quotes |\n| Double percent for modulo | `set /a r=14 %% 3` in batch files |\n\n## Cross-Platform and Extended Tools\n\nWhen batch scripting reaches its limits, these tools extend cmd.exe capabilities:\n\n| Tool | Purpose |\n|------|---------|\n| **Cygwin** | Full POSIX environment on Windows (grep, sed, awk, ssh) |\n| **MSYS2** | Lightweight Unix tools and package manager (pacman) |\n| **WSL** | Windows Subsystem for Linux — run native Linux binaries |\n| **GnuWin32** | Individual GNU utilities as native Windows executables |\n| **PowerShell** | Modern Windows scripting with .NET integration |\n\nUse batch when you need: fast startup, simple file operations, PATH-based CLI tools, or Task Scheduler integration. Consider PowerShell or WSL for complex data processing, REST APIs, or object-oriented scripting.\n\n## CMD Keyboard Shortcuts\n\n| Shortcut | Action |\n|----------|--------|\n| `Tab` | Auto-complete file/folder names |\n| `Up` / `Down` | Navigate command history |\n| `F7` | Show command history popup |\n| `F3` | Repeat last command |\n| `Esc` | Clear current line |\n| `Ctrl+C` | Cancel running command |\n| `Alt+F7` | Clear command history |\n\n## Reference Files\n\nThe `references/` folder contains detailed documentation:\n\n| File | Contents |\n|------|----------|\n| `tools-and-resources.md` | Windows tools, utilities, package managers, terminals |\n| `batch-files-and-functions.md` | Example scripts, techniques, best practices links |\n| `windows-commands.md` | Comprehensive A-Z Windows command reference |\n| `cygwin.md` | Cygwin user guide and FAQ |\n| `msys2.md` | MSYS2 installation, packages, and environments |\n| `windows-subsystem-on-linux.md` | WSL setup, commands, and documentation |\n\n## Asset Templates\n\nThe `assets/` folder contains starter batch file template data, but as text files:\n\n| Template | Purpose |\n|----------|---------|\n| `executable.txt` | Standalone CLI tool with argument parsing |\n| `library.txt` | Reusable function library with CALL-able labels |\n| `task.txt` | Scheduled task / automation script |","tags":["batch","files","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-batch-files","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/batch-files","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (16,732 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:06.177Z","embedding":null,"createdAt":"2026-04-28T06:51:56.718Z","updatedAt":"2026-05-18T18:52:06.177Z","lastSeenAt":"2026-05-18T18:52:06.177Z","tsv":"'-5':796 '-6':802 '/a':422,902,911,917,921,933,1965,1980 '/b':632,857,870,879,979,991,998,1005,1014,1022,1564,1584,1590,1597,1614,1643,1704,1720 '/c':1020 '/d':581 '/f':592,610 '/i':484,755,761,1600,1608 '/l':414,544 '/p':1856 '/r':570 '0':202,326,412,471,659,785,801,858,871,957,970,1006,1591,1598,1615,1644,1721 '077':948 '0x0f':936 '0xff':945 '1':191,256,417,418,424,547,548,594,633,664,673,675,685,691,698,706,711,735,737,742,750,756,762,864,919,964,992,999,1015,1391,1514,1530,1579,1585,1595,1601,1609,1647,1690,1780 '10':549,913,1272,1277,1787 '100':1426,1430 '14':923,1982 '2':211,252,255,595,767,1394,1506,1513,1529,1580,1605,1664,1781 '255':935 '3':233,915,924,1684,1983 '32':904 '32767':327 '4':246,1701 '42':1023,1028 '5':419,786,914,1714 '6':791,1730 '7':152,1749 '8':1761 '9':203,665,1772 'a-z':2147 'abl':2202 'account':1255 'action':2086 'add':1216,1892 'administr':68 'all.log':1512 'alpha':531 'alphabet':1148 'alt':2116 'alway':497,1648,1824 'api':2076 'append':249,1501 'appli':62 'archiv':1121,1127 'arg':748,752,772,773,874,1569,1593,1619 'argument':206,210,282,656,667,669,674,684,690,697,705,710,734,741,743,1671,2193 'arithmet':900,908 'around':295 'arp':1260,1261 'ask':21 'asset':2171,2174 'assoc':1363 'associ':1367 'asynchron':1297 'attrib':1082 'attribut':1087 'auto':2089 'auto-complet':2088 'autom':31,38,69,93,1280,2207 'avoid':1708,1854 'awk':2014 'b':604 'backup':99 'base':78,140,149,2060 'base64':1165 'bat':29,89,175,267,360,384,407,444,493,520,622,746,778,808,830,846,909,965,985,1003,1388,1417,1475,1490,1544 'bat/.cmd':10,59 'batch':2,8,25,37,45,57,118,127,139,205,228,647,718,728,930,1433,1539,1805,1934,1985,1994,2049,2178 'batch-bas':138 'batch-fil':1 'batch-files-and-functions.md':2138 'batch/function':1012 'best':1645,2142 'beta':532 'bin':106,161 'binari':1160,2032 'bit':905,934 'bitwis':938,943 'block':383,395,899,1771,1922,1971 'bodi':1798 'build':100 'built':157 'built-in':156 'bulk':1486 'c':2112 'cab':1116,1120 'cach':1262 'call':843,849,872,1401,1561,1567,1581,1611,2201 'call-abl':2200 'caller':1663,1745 'cancel':2113 'capabl':2003 'caret':215,1412,1440,1448,1951 'case':487 'case-insensit':486 'caus':1793 'cd':308 'certutil':1163 'char':1961 'charact':218,226,1410,1416,1461,1465,1699 'chcp':1347 'check':1669,1896 'choic':1328 'clean':1784 'clear':2108,2118 'cli':64,101,2061,2190 'clip':1149 'clipboard':1154 'close':1709 'cmd':17,35,91,176,1019,2082 'cmd.exe':61,155,182,355,2002 'code':330,976,1002,1352,1718,1901 'color':1354,1357 'command':169,180,242,333,473,492,589,654,1031,1035,1132,1170,1224,1281,1314,1317,1326,1378,1491,1498,1505,1511,1520,1527,1823,1905,1939,2096,2100,2106,2115,2119,2151,2168 'command-lin':653 'command1':494,500,507,509,516,986,988 'command2':495,501,504,510,513,993,995 'comment':1791 'comp':1159 'compact':1107 'compar':1156 'comparison':475,490,1162 'complet':1427,1431,2090 'complex':2072 'compound':241,491,1377 'comprehens':48,2146 'compress':1112 'comput':1166,1178 'comspec':352 'condit':442,1386 'configur':172,1175,1232,1258,1336 'connect':1229,1238 'consid':2067 'consider':1800 'consol':1337,1351,1356,1360,1712,1866 'contain':828,837,1819,2126,2176 'content':1040,1091,2130 'control':440,1204 'convent':956 'copi':1041,1042,1046,1052,1150 'count':411,423,426 'counter':918 'creat':23,51,86,1070,1077,1119,1123,1284,1325 'credenti':1803,1810,1871 'cross':1988 'cross-platform':1987 'ctrl':2111 'curl':132,1268 'current':309,335,339,646,1184,2109 'cygwin':2006,2154 'cygwin.md':2153 'd':582,586 'd1':686 'data':1407,2073,2181 'data.csv':1398,1403 'data.txt':615 'date':311,313,1311 'debug':14,53,117,1875 'dedic':1870 'default':177 'defin':374,453,1572,1679 'del':1062,1846 'delay':390,402,433,1917 'delet':1063,1217,1853 'delim':596 'depend':316 'deploy':98 'describ':1555 'destin':1104 'detail':2127 'develop':66 'differ':1301 'dir':766,1037,1476 'directori':162,310,347,557,578,1039,1071,1075,1098,1748 'discard':262,1532 'display':1095,1097,1177 'distribut':166 'dns':1234 'document':2128,2170 'doe':852 'done':753,774 'doskey':1324 'doubl':1975 'dp0':712,1732 'drive':687,695,713,1199,1250,1345 'driver':1211 'driverqueri':1208 'earli':1675 'earth':816,819 'echo':273,425,448,456,463,466,472,535,551,563,575,585,603,617,627,636,783,789,794,799,813,820,836,847,853,971,987,994,1389,1392,1399,1405,1418,1425,1434,1451,1545,1574,1586,1621,1627,1628,1630,1636,1651,1777,1883,1887,1899 'edit':52,88 'els':465,1404 'enabl':1925 'enabledelayedexpans':409,1548,1763 'enclos':224,677 'encode/decode':1164 'end':542,1469 'endloc':359,367,385,427,865,889 'ensur':1738 'environ':199,265,1221,1808,2009,2164 'eof':641,643 'equ':477 'error':123,952,954,972,1575,1774,1778,1897 'errorlevel':328,469,968,977,980,1026,1565,1902 'errors.log':1507 'esc':2107 'escap':214,216,1409,1413,1441,1959,1966 'essenti':1030 'evalu':406 'exampl':2139 'example.bat':1552 'execut':79,349,431,443,1313,1321,1387,1881,2040 'executable.txt':2188 'exist':446,1397,1674,1683 'exit':329,631,644,856,869,878,978,990,997,1001,1004,1013,1021,1563,1583,1589,1596,1613,1642,1703,1707,1717,1719,1900 'expand':207,397,429,435,1113 'expans':122,391,403,1918 'expert':5 'expert-level':4 'express':1144,1371 'extend':1045,1991,2001 'extens':350,703,708,725 'extern':130 'extract':1114,1125 'f':559,564,571,576 'f1':680 'f3':2103 'f7':2098,2117 'fail':474,517,974,982,989,996 'fail-fast':981 'failur':962,1018,1729 'faq':2158 'fast':983,2053 'fc':1155 'file':3,9,26,46,58,72,92,96,229,346,449,554,567,607,700,719,722,729,731,931,1033,1043,1061,1064,1067,1086,1090,1094,1102,1117,1158,1161,1309,1365,1481,1497,1504,1526,1540,1673,1806,1839,1935,1986,2056,2122,2129,2179,2185 'file.txt':1492,1499 'file/folder':2091 'find':1134,1308 'findstr':600,1139,1454 'flow':441 'folder':107,1343,2125,2175 'forfil':1307 'found':450,1408 'four':187 'free':1473 'ftype':1364 'full':681,1173,2007 'function':839,840,877,883,2197 'gamma':533 'geq':482 'get':1348 'git':133 'gnu':2035 'gnuwin32':2033 'go':464 'goto':619,623,640,642,751,758,770,1617 'greet':850,855,859,867 'grep':2012 'group':245,1187,1374 'gtr':481 'guid':2156 'handl':953,1695 'hard':1080 'hash':1167 'hello':271,781,788,804,811,818,822,826,863 'help':757,1610,1626,1637,1640 'hexadecim':944 'hh':320 'histori':1867,2097,2101,2120 'host':1245 'hostnam':1176 'http':1269 'immedi':439 'includ':174 'individu':2034 'info':1188 'inform':1169 'inject':1822 'inlin':1029 'input':251,1152,1334,1666,1816,1827,1859,1860 'input.txt':1521 'insensit':488 'insid':393,1767,1795,1921,1969 'inspect':1906 'instal':1210,2161 'instead':1705 'integ':907 'integr':126,2047,2066 'intend':103 'interpret':181,222 'invok':663,875 'ip':1231 'ipconfig':599,1230 'ipv4':601 'issu':120,1794,1919 'iter':522 'jane':851 'jpeg':1483 'jpg':1484 'keep':1782 'key':1333 'keyboard':2083 'label':621,650,842,873,2203 'last':332,2105 'later':154 'launch':1295 'leak':1834 'leakag':1660 'legaci':1049 'leq':480 'letter':688,1346 'level':6,124,955,1898 'librari':2198 'library.txt':2195 'lightweight':2017 'limit':1142,1998 'line':185,236,608,655,1147,1390,1393,1435,1437,1940,2110 'link':1081,2144 'linux':2028,2031 'list':283,288,351,1038,1190,1209,1911 'liter':232,949,1137 'local':315,363,369,388 'locale-depend':314 'locat':1320 'log':573,1056,1760 'logic':625,635,639 'longer':373 'lookup':1235 'loop':519,1768,1797,1929 'lss':479 'macro':1327 'main':624,634,638,1562,1566 'maintain':16,55 'makecab':1118 'manag':1253,1263,1267,1286,2022,2136 'map':1342 'map/disconnect':1248 'mark':220 'match':1457,1462 'md':1068 'meaning':1716 'memori':1201 'merg':257,1516 'messag':1641,1779 'mirror':1055,1758 'mkdir':1069 'mklink':1076 'mm':321 'mode':1335 'modern':2042 'modifi':1765 'modulo':928,1978 'move':1057,1058 'msg':862,868 'msys2':2016,2160 'msys2.md':2159 'mycommand':973 'mycommand.exe':966 'n':1291 'n1':699 'name':297,301,337,661,701,723,1179,1945,1949,2092 'nativ':2030,2038 'navig':2095 'need':1450,2052 'neq':470,478,969 'net':1246,1251,2046 'netsh':1256 'netstat':1236 'network':1223,1228,1237,1249,1257 'never':1801 'new':137 'newlin':1443 'next':1415 'node.js':134 'noisi':1656 'non':960,1725 'non-zero':959,1724 'nslookup':1233 'nt':148 'nt-base':147 'ntfs':1111 'nul':261,1528 'number':325 'numer':538 'nx0':629,721,1623 'object':2079 'object-ori':2078 'octal':947 'one':1436 'oper':73,97,476,941,1034,1214,2057 'option':159,170,630,1629 'order':190 'orient':2080 'os':150,1200 'output':263,590,763,765,1422,1429,1534,1657 'output.txt':447,1395 'overwrit':248,1494 'p1':692 'packag':2021,2135,2162 'pacman':2023 'page':1353 'pagin':1093 'parent':1711,1836 'parenthes':244,394,1372,1375,1770,1962 'pars':235,399,437,588,606,744,747,771,1568,1592,1618,2194 'pass':893,1844 'path':77,109,164,342,353,682,693,715,736,739,1323,1625,1632,1686,1693,1737,1840,1842,2059 'path-bas':76,2058 'pathext':171,348 'pattern':745,984 'paus':1893 'percent':1976 'perform':903 'period':1472 'period-fre':1471 'persist':1220 'ping':1226 'pipe':1151,1446,1786,1953,1956 'pipelin':240 'platform':1989 'popup':2102 'port':1240,1340 'posit':666 'posix':2008 'possibl':1874 'powershel':2041,2068 'practic':1646,2143 'prefer':1750 'prefix':287,292 'prerequisit':145 'prevent':221,1655,1830,1851 'print':1089 'process':183,776,1131,1192,1195,1400,1402,1587,1634,1668,1837,2074 'product':1537 'production-qu':1536 'profil':341 'program':1296 'project':141 'prompt':1329,1813 'pseudorandom':324 'purpos':1036,1133,1171,1225,1282,1318,1554,2005,2187 'python':135 'qualiti':1538 'queri':1198,1205,1215 'quot':125,212,678,1685,1825,1974 'quotat':219 'r':1981 'random':323 'rang':539 'rd':1072,1847 'reach':1996 'read':250,1523 'readi':462 'recurs':566 'redirect':247,253,1384,1488,1509 'refer':204,1032,2121,2124,2152 'reg':1212 'regardless':1742 'registri':1213 'regular':1143 'relat':1736 'reliabl':1755 'rem':368,496,502,511,521,537,553,565,577,587,605,787,792,797,803,817,823,925,937,1007,1016,1024,1421,1428,1439,1478,1485,1493,1500,1508,1515,1522,1531,1549,1550,1553,1560,1789 'remaind':922 'remov':679,825,1074,1882 'ren':1065,1482 'renam':1060,1066,1487 'repeat':2104 'replac':197,807,1100,1101 'request':1270 'requir':1578,1635,1670 'rest':2075 'restart':1306 'result':387,854,912 'retri':1054,1757 'return':377,880,1008,1017,1715 'reusabl':2196 'rmdir':1073 'robocopi':1050,1751,1849 'robust':1051 'rout':1243,1264,1265 'run':498,503,512,637,1191,1299,2029,2114 'runa':1298 'runtim':405 'safe':1700 'sanit':1838 'sc':1202 'scaffold':136 'schedul':39,70,111,116,1278,1287,2065,2205 'schtask':114,1283 'scope':356,365,382,898 'script':18,30,36,41,44,74,80,113,119,128,167,660,886,1542,1551,1558,1735,1740,1995,2044,2081,2140,2208 'script-rel':1734 'search':568,738,805,1129,1135,1140 'second':1292 'section':1895 'secur':1274,1799 'sed':2013 'segment':1474 'sensit':1858 'sequenc':1459 'servic':1203 'set':268,276,279,286,296,299,362,386,410,421,459,525,764,779,809,861,866,890,901,910,916,920,932,1000,1025,1085,1110,1219,1350,1355,1359,1603,1855,1908,1943,1944,1948,1964,1979 'setloc':358,361,408,860,1547,1654,1829 'setlocal/endlocal':845 'setup':2167 'setx':1218 'shell':43,1275,1315,1368 'shift':672,768,769,1606,1616 'shortcut':2084,2085 'show':1108,1638,2099 'shutdown':1303,1304 'sign':906 'simpl':2055 'singl':1332,1381,1464 'single-key':1331 'size':732,1338 'skill':11,49,85 'skill-batch-files' 'sort':1145,1146 'sourc':1106 'source-github' 'space':294,1696,1941 'special':217,225,304,1698,1960 'specif':1728 'split':238 'ss.mm':322 'ssh':1273,2015 'stage':188 'standalon':2189 'standard':1541 'start':290,540,651,1206,1294,1649,1914 'starter':2177 'startup':2054 'status':461 'stderr':254,258,1510,1517,1776 'stdin':1524 'stdout':260,1495,1502,1519,1783 'step':541,1890 'stop':1207 'store':1802,1811,1864 'str':780,784,790,795,800,810,814,821,833,835 'string':489,775,1138 'structur':143,1099,1543 'subdirectori':1048 'subroutin':649 'subst':1341 'substitut':193 'substr':777,827 'subsystem':2026 'succeed':508 'success':958,1009,1723 'summari':1420,1424,1489 'support':940,951,1756 'symbol':1078 'syntax':234,657,1369,1927 'system':67,312,318,1168,1174 'systeminfo':1172 'tab':2087 'tabl':1266 'tar':1122,1126 'target':1573,1576,1588,1602,1604,1624,1631 'task':34,40,71,95,112,115,1288,2064,2206 'task.txt':2204 'taskkil':1193 'tasklist':1189 'techniqu':1878,2141 'temp':343 'templat':144,2172,2180,2186 'temporari':345 'temporarili':1889 'termin':1194,2137 'test':829,1227 'text':1128,2184 'time':317,319,400,432,438 'timeout':1289 'titl':1358,1362 'tmp':344 'token':195,593,612 'tool':65,102,131,1872,1992,2000,2004,2019,2062,2133,2191 'tools-and-resources.md':2131 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'total':1419,1423 'trace':1242,1880 'tracert':1241 'tree':1096 'trick':891 'tripl':1447 'troubleshoot':1877 'turn':1376 'two':1157,1438 'txt':561,1477,1480 'type':1088,1366 'typic':963 'unaffect':670 'unintend':1852 'unit':1382 'unix':2018 'unquot':1817 'updat':1924 'usag':626,628,759,1582,1612,1620,1622 'use':19,60,83,401,483,841,887,926,1247,1676,1689,1702,1731,1762,1788,1807,1828,1868,1886,1931,1957,1973,2048 'usebackq':611 'user':336,340,1185,1252,1254,1302,1815,1826,2155 'usernam':334 'userprofil':338 'util':1259,1316,2036,2134 'val':298,303 'valid':1665,1814,1841 'valu':201,307,366,379,527,658,894,1832,1946,1950 'var':194,270,275,278,364,370,389,428,434,455,1926 'variabl':121,192,200,264,266,285,289,300,305,306,392,457,1222,1659,1688,1766,1809,1818,1831,1907,1913,1920 'ver':1180 'version':1182 'view':1083 'visibl':1862 'vista':1293 'vs':1930 'wait':467,1290 'whoami':1183 'wildcard':1456 'window':7,33,42,56,94,146,151,179,1181,1271,1276,1361,1713,2011,2025,2039,2043,2132,2150 'windows-commands.md':2145 'windows-subsystem-on-linux.md':2165 'without':694 'wmi':1197 'wmic':1196 'work':1741,1747 'world':272,782,793,798,812,815,824,834,838 'write':13,27,110,1535,1773 'wsl':2024,2070,2166 'x':1452,1455 'x1':707 'xcopi':1044,1753 'y':1453 'yield':230 'z':2149 'z1':730 'zero':961,1467,1726","prices":[{"id":"5e9705f6-6e9f-4acd-8ea0-d7ed60b08b8a","listingId":"583b40ba-8511-4c08-8f4a-40b929fe0006","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-28T06:51:56.718Z"}],"sources":[{"listingId":"583b40ba-8511-4c08-8f4a-40b929fe0006","source":"github","sourceId":"github/awesome-copilot/batch-files","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/batch-files","isPrimary":false,"firstSeenAt":"2026-04-28T06:51:56.718Z","lastSeenAt":"2026-05-18T18:52:06.177Z"}],"details":{"listingId":"583b40ba-8511-4c08-8f4a-40b929fe0006","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"batch-files","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"73005d4edc8d4b398422a6c1400c50b7b9874070","skill_md_path":"skills/batch-files/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/batch-files"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"batch-files","description":"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."},"skills_sh_url":"https://skills.sh/github/awesome-copilot/batch-files"},"updatedAt":"2026-05-18T18:52:06.177Z"}}