How to open Powershell with administrative privileges from CMD
PowerShell and Command Prompt (CMD) possess a lot of overlapping functions, 'stepping in' each other. But what if you specifically need to open PowerShell from the Command Prompt or a batch file? Find out how to do it right here.
How to open PowerShell from administrator CMD
When you run any application from Command Prompt with elevated privileges for Admin, that application will also be launched with administrative privileges. The same applies to batch files - if the script is run as administrator, any applications started by the script will also be run as administrator. At this point, just type the powershell command into the Command Prompt to launch PowerShell with administrator privileges.
(Note: On Windows 10, running the powershell command in Command Prompt will open a new PowerShell window. If you're using Windows 11, the command will work a little differently. Command Prompt launches in Windows Terminal and when If you run PowerShell from the Command Prompt, it will open in the same window.
How to open Powershell with administrative privileges from CMD Picture 1
How to open PowerShell from any CMD
Starting PowerShell with administrative privileges from a regular, non-elevated Command Prompt window is a rather 'clumsy' way to do it. Basically, you'll need to 'wake up' PowerShell from the Command Prompt to launch another PowerShell window.
To do so, type or paste the command powershell start-process powershell -verb runas into the Command Prompt, and then press Enter. A new elevated PowerShell window (with administrative privileges) will appear.
Be careful when performing any task in an enhanced PowerShell environment. Any mistake can cause your system problems.
You should read it
- Use PowerShell to download any file on Windows 10
- How are Command Prompt (cmd) and PowerShell different?
- Add Command Prompt to Power User Menu on Windows 10
- PowerShell command in Windows
- About PowerShell
- How to install PowerShell 7.0 in Windows 10/8/7
- How to add 'Open PowerShell window here as administrator' to the right-click menu on Windows 10
- Instructions on how to use PowerShell in Windows Server 2012
- How to use PowerShell's default parameter to change the command behavior
- 10 PowerShell commands help you manage the remote computer most effectively
- Microsoft urges Admin to patch PowerShell vulnerability on Windows
- How to check PowerShell version in Windows 10
May be interested
How to Enable USB Booting on a Chromebook
How to view and change the refresh rate of the Windows screen
TPM firmware error causes AMD computers running Windows 11, 10 to hang and a temporary fix
How to disable the Fast Startup feature on Windows
How to Execute a Program in Command Prompt
How to Arrange Icons on the Desktop Horizontally