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 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
- 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
May be interested
- How to Enable USB Booting on a Chromebooktoday's tipsmake will show you how to enable usb booting on your chromebook. this setting is only available after you enable developer mode, which will erase all data on your chromebook.
- How to view and change the refresh rate of the Windows screenwhat is the screen refresh rate? what does screen refresh rate mean? how to view and change the computer screen refresh rate?
- TPM firmware error causes AMD computers running Windows 11, 10 to hang and a temporary fixover the last month or two, many computers with amd ryzen chips running windows 11 and windows 10 with tpm firmware (ftpm) enabled have been frozen or frozen. amd has just released a temporary fix after determining the cause of the problem.
- How to disable the Fast Startup feature on Windowsto partially overcome the slow system startup of windows computers, microsoft has introduced a feature called 'fast startup'
- How to Execute a Program in Command Promptthis article shows you how to open a program on a windows computer using the command prompt application. although you can only open programs that are installed in folders created by windows (such as desktop), you are still allowed to add the program's folder to the command prompt list to open the program with the command prompt.
- How to Arrange Icons on the Desktop Horizontallytoday's tipsmake will show you how to arrange the icons on the desktop of your windows or mac computer horizontally. this operation is not easy, if you use windows, you will have to change some settings first, then you can drag and drop icons horizontally.