SOLID Batch
Hard limits
- Keep
.batfiles thin (prefer < 80 lines) - Delegate real logic to PowerShell or Python
Practices
setlocalat the topcd /d "%~dp0"for portable relative paths- Check
errorlevelafter critical calls - Do not hardcode secrets or private LAN defaults when a prompt/env exists
- Echo security notes when launching network-facing tools without auth
Checklist
- Launcher only orchestrates
- Failures exit with non-zero codes
- Paths are relative to
%~dp0