Key facts
| Gen 1 | |
|---|---|
| Gen 2 | |
| Kind of tool | Languages and runtimes |
| Status of Gen 1 | Still active Microsoft Learn's Windows Commands page says all supported versions of Windows and Windows Server have the commands built in, and recommends PowerShell for automation (read on November 28, 2026). |
| Effort to move | Mechanical: same ideas, different calls |
| What breaks | Batch syntax does not carry over, so every script is rewritten. Scripts that call powershell.exe still start Windows PowerShell, because PowerShell 7 runs as pwsh.exe. |
| Should you move? | Move when convenient Microsoft ships and documents the Command shell and has not said it is going away, so nothing forces a date. It does recommend PowerShell for new automation. This is gen2.dev's view, not the maintainers'. |
| Sources checked | 2026-11-28, 4 sources |
This one is not retired. Microsoft ships both shells and points new work to one of them.
What Gen 1 was
Batch files are scripts for the Command shell, cmd.exe. Microsoft's Windows Commands page says "The Command shell was the first shell built into Windows to automate routine tasks, like user account management or nightly backups, with batch (.bat) files."
It is still there. The same page says "All supported versions of Windows and Windows Server have a set of Win32 console commands built in." Microsoft has not announced an end date for it in anything we read.
What replaced it
PowerShell 7. Microsoft's pages say so, in different words. The Windows Commands page says "we recommend using PowerShell instead of Windows Commands or Windows Script Host for Windows automation." The cmd page says users who want more advanced capabilities "are encouraged to explore PowerShell for enhanced scripting and automation."
PowerShell 7 is not the PowerShell built into Windows. That is Windows PowerShell 5.1, and Microsoft's comparison page says it is "built on top of the .NET Framework v4.5." PowerShell 7 is the newer, open source line. It "runs on Windows, macOS, and Linux." Picking 7 over 5.1 is gen2.dev's view, not Microsoft's.
The language is built differently. Microsoft says "Unlike most shells that only accept and return text, PowerShell accepts and returns .NET objects."
What moving involves
Rewrite the scripts one at a time. A batch file and a PowerShell script do the same jobs in different syntax, so there is no converter to trust. Start with the scripts you change most, and run the old and new versions side by side until the output matches. This is the strangler fig pattern applied to scripts.
You do not have to drop the old commands first. Microsoft says "You can run both Windows Commands and PowerShell cmdlets in PowerShell," so a new script can call an existing command while you replace the rest.
Most scripts are small, which is why the effort is rated Mechanical. A large estate with scheduled tasks, installers and build steps that call batch files is a bigger job, and you should count them first.
What breaks
The syntax. Variables, loops, error handling and string quoting all differ, so nothing is pasted across.
The program name. The comparison page says the binary was renamed from powershell.exe to pwsh.exe "support side-by-side installations of Windows PowerShell and PowerShell." A scheduled task or shortcut that still says powershell.exe keeps starting Windows PowerShell 5.1.
Some Windows PowerShell features. The same page lists modules no longer shipped with PowerShell 7 and says PowerShell Workflow was removed. A script written for 5.1 may need changes, and PowerShell 7 includes a compatibility feature for Windows PowerShell modules that still need the full .NET Framework.
Scripts that run on other systems. The page warns that "scripts that run on Windows may not run on non-Windows platforms" when they call .NET directly.
Should you move?
Move when convenient. That is gen2.dev's opinion, and the view of the site owner. Microsoft still ships and documents the Command shell, so nothing forces a date.
Leave a short batch file that works and nobody edits. Write new automation in PowerShell 7, and rewrite an old script when you are already changing it. If a script has grown past a screen of if and goto, that is the one to move first.
Common questions
Is Windows Batch dead?
No. Its maintainers have not announced an end. Microsoft Learn's Windows Commands page says all supported versions of Windows and Windows Server have the commands built in, and recommends PowerShell for automation (read on November 28, 2026).
What replaced Windows Batch?
PowerShell 7. Effort to move: Mechanical: same ideas, different calls
Should I move off Windows Batch?
gen2.dev's view: Move when convenient. Microsoft ships and documents the Command shell and has not said it is going away, so nothing forces a date. It does recommend PowerShell for new automation.
Sources
- Windows commands - Microsoft Learn - that the Windows Commands are built into all supported versions of Windows, that the Command shell was the first Windows shell and runs batch (.bat) files, and Microsoft's recommendation of PowerShell for automation
- cmd - Microsoft Learn - what cmd.exe is, and that users who want more advanced capabilities are encouraged to explore PowerShell
- What is PowerShell? - Microsoft Learn - that PowerShell is a cross-platform shell, scripting language and configuration management framework that runs on Windows, Linux and macOS, and that it passes .NET objects instead of text
- Differences between Windows PowerShell 5.1 and PowerShell 7.x - Microsoft Learn - that Windows PowerShell 5.1 is built on the .NET Framework while PowerShell 7 runs on .NET, the rename of powershell.exe to pwsh.exe for side-by-side installs, the Windows PowerShell Compatibility feature, and the removal of PowerShell Workflow
Sources checked on 2026-11-28. Tools change status quickly; if this date is old, read the sources before acting on it.

