# Windows Batch to PowerShell 7: Status and Move | gen2.dev

> Microsoft still ships the Command shell and .bat files, but recommends PowerShell for automation. What moving to PowerShell 7 involves, and what breaks.

Source: https://gen2.dev/successors/windows-batch/

---

Successor Map · Languages and runtimes

# Windows Batch to PowerShell 7: batch still ships, but Microsoft points to PowerShell

Batch files are not retired. The Command shell is built into every supported version of Windows. Microsoft's own documentation, though, recommends PowerShell over Windows Commands for automation, and PowerShell 7 also runs on Linux and macOS.

![Slide: Windows Batch on the left, an arrow, and PowerShell 7 on the right.](https://gen2.dev/img/successor-windows-batch.png)

Status of the old tool

Still active

Effort to move

Mechanical

gen2.dev's view

Move when convenient

Sources checked

2026-11-28

## Key facts

Gen 1

![Windows Batch logo](https://gen2.dev/icons/tech/windows-batch.png)Windows batch scripts (.bat and .cmd files run by cmd.exe)

Gen 2

![PowerShell 7 logo](https://gen2.dev/icons/tech/powershell7.png)PowerShell 7

Kind of tool

[Languages and runtimes](https://gen2.dev/successors/languages/)

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](#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](https://gen2.dev/guide/strangler-fig/) 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

1.  [Windows commands - Microsoft Learn](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands) - 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
2.  [cmd - Microsoft Learn](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) - what cmd.exe is, and that users who want more advanced capabilities are encouraged to explore PowerShell
3.  [What is PowerShell? - Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/overview) - 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
4.  [Differences between Windows PowerShell 5.1 and PowerShell 7.x - Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.5) - 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.

## How to do the move

The pattern that fits this kind of replacement:

[Characterization tests](https://gen2.dev/guide/characterization-tests/)

[All successor entries](https://gen2.dev/successors/)

## More in Languages and runtimes

-    [![CoffeeScript logo](https://gen2.dev/icons/tech/coffeescript.png) CoffeeScript to TypeScript Still active A real project Move when convenient](https://gen2.dev/successors/coffeescript/)
-    [![ES5 JavaScript logo](https://gen2.dev/icons/tech/es5-javascript.png) ES5 JavaScript to modern JavaScript Still active Mechanical Move when convenient](https://gen2.dev/successors/es5-javascript/)
-    [![Flow logo](https://gen2.dev/icons/tech/flow.png) Flow to TypeScript Still active A real project Move when convenient](https://gen2.dev/successors/flow/)
-    [![.NET Framework logo](https://gen2.dev/icons/tech/dotnet-framework.png) .NET Framework to .NET Maintenance only A real project Leave it](https://gen2.dev/successors/dotnet-framework/)
-    [![nvm logo](https://gen2.dev/icons/tech/nvm.png) nvm to fnm Still active Drop-in Leave it](https://gen2.dev/successors/nvm/)
-    [![Perl 5 logo](https://gen2.dev/icons/tech/perl.png) Perl 5 to Python Still active A real project Move when convenient](https://gen2.dev/successors/perl/)
-    [![PHP 8.2 and older logo](https://gen2.dev/icons/tech/php-8-2.png) PHP 8.2 and older to PHP 8.4+ Maintenance only Mechanical Move now](https://gen2.dev/successors/php-8-2/)

[All languages and runtimes](https://gen2.dev/successors/languages/)
