PowerShell and Command Prompt (CMD) have a lot of overlapping functionality, but what if you specifically need to open PowerShell from Command Prompt or a batch file? Here’s how you do it.
How to Open PowerShell From Administrator CMD
When you run any application from an elevated Command Prompt, that application also starts with administrative privileges. The same applies to batch files — if the script was run as administrator, then any applications started by the script will also be run as administrator. Type
powershellinto Command Prompt to start PowerShell with admin privileges.
Note: On Windows 10, running
powershellin Command Prompt will open a new PowerShell window. If you’re using Windows 11, it’ll behave a bit differently. Command Prompt launches in Windows Terminal, and when you run PowerShell from Command Prompt, it just runs it within the same window.
How to Open PowerShell From Any CMD
Starting PowerShell with administrative privileges from a regular, non-elevated Command Prompt window is a pretty roundabout way of doing things. You actually need to invoke PowerShell from Command Prompt to launch a different PowerShell window.
To do so, type or paste
powershell start-process powershell -verb runas into Command Prompt, and then hit Enter. A new elevated PowerShell window will appear.
As always, be careful doing things in an elevated PowerShell environment. You may want to read more about some of the advanced features PowerShell has to offer.
- › How to Enable or Disable Memory Compression in Windows 11
- › How to Add a Shortcut to Pretty Much Anything on Android
- › 10 Kodi Features You Should Be Using
- › 6 Ways Our Tech Is Better Than Star Trek’s
- › 5 Ways to See If Your Phone Is Being Tapped
- › What You Should (and Shouldn’t) Unplug or Turn Off When You Go On Vacation
- › Update iTunes on Windows Now to Fix a Security Flaw