List of content you will read in this article:
While almost any regular Windows user has heard of and probably used the command prompt at some point, it is unlikely that many know what PowerShell is. Well, it is time to expand your horizons, as PowerShell is a much more powerful tool than the command prompt. Microsoft intends to replace the command prompt with PowerShell as it provides much more control over the Windows operating system. This article will explain PowerShell and how to run Powershell as administrator in various ways.
What is PowerShell?
As per Microsoft’s definition: “PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework.” However, this statement might sound foreign to the regular user, so let’s break it down a little.
First, let us understand what a ‘shell’ is in IT. It is a user interface that provides access to various services of an operating system. A shell’s interface can be either command-line or have a graphical user interface.
It is a shell that was initially developed by Microsoft, based on the .NET framework, for the purposes of configuration management and task automation in Windows OS. However, it has become an open-source software available on Windows, Linux, and even macOS. The software includes a command-line interface and a scripting language.
How to Run Powershell as Administrator?
There are many ways to open PowerShell as admin access. Here are some of the most common ones:
1. Run PowerShell from CMD
- To run PowerShell from CMD, you only need to type the following command into the prompt.
PowerShell
- Once PowerShell is open, please type the following command to force it into Administrator mode.
Start-Process PowerShell -Verb runAs
[To open the command prompt, press the Windows key and R simultaneously to open the Run box. Then, type cmd into it and press enter.]
2. Open PowerShell as Administrator from Cortana
First, click on Cortana and type PowerShell.
After finding Windows PowerShell, right-click on it and click Run as Administrator.
Note: If your UAC is enabled, an alert will be displayed to open PowerShell by clicking Yes.
3. Open PowerShell from the Run window
- Press the Windows key and R simultaneously on your keyboard to launch the Run window.
- Type PowerShell and click OK to return to PowerShell.
- Then, type the following command to force PowerShell to Run as Administrator.
Start-Process PowerShell -Vert runAs
Note that this command can access and go to Administrator mode whenever PowerShell is open.
4. Open PowerShell from the WinX menu
- In Windows 10, right-click on the Start icon or press the Windows and X keys simultaneously.
- In this menu, click on Windows PowerShell (Admin).
5. Open PowerShell via Task Manager
- Combine the Ctrl + Shift + Esc keys to open the Task Manager.
- Select Run new task from the File menu.
- Type "PowerShell, " select "Create this task with administrative privileges," and click OK.
6. Run PowerShell as administrator from the start menu
- Open the Start menu.
- Open the Windows PowerShell directory.
- Right-click on Windows PowerShell and click Run as administrator.
Note: In Windows 7 and Vista, PowerShell is located under the Accessories menu.
7. Run it as an Administrator Using the Power User Menu
For people who want a quick access to different system tools, using the power user menu to run PowerShell as an administrator is a handy tool in Windows 11. To use this menu, follow these steps:
- To access the menu quickly, right click on Start. Also, you can press the Win + X keys on your keyboard to access menu.
- In the second step, select Terminal (Admin) from the list of the menu.
- At last, UAC will be displayed on the screen. You need to click Yes to grant permission.
8. Run it as an Administrator using Windows File Explorer
Here we explain how to open Windows PowerShell as an administrator using File Explorer's address bar. It’s very easy! Let’s start:
- Open File Explorer: Before anything, open the file explorer by pressing Windows key + E on your keyboard.
- Go to the PowerShell folder: Now you need to enter the address. Just find the address bar at the top of File Explorer and type this: C:\Windows\System32\WindowsPowerShell\v1.0. Now, press enter.
- Locate the PowerShell executable: To locate the PowerShell executable, find a file with that named "PowerShell.exe".
- Run as administrator: To run as administrator, right-click on the "PowerShell.exe" file and choose “Run as administrator”.
- Confirm permission: To confirm the permission, it will prompt you to click Yes. Do it to grant administrator privileges.
Done! Now, you can see a Windows PowerShell window with administrator rights and permissions. With these rights, you can carry out operations that require elevated privileges. For example, you can change system settings or install different applications.
9. Using the Windows Search Tool
In only a few steps, you can open Windows PowerShell as an administrator if you use the Windows Search tool. Do this easy process following these easy steps:
- Open Windows Search by pressing the Win + S keys or just clicking on this.
- In the search bar of Windows, type "PowerShell".
- In the right pane, choose “Run as administrator”.
- If prompted, click Yes to grant admin privileges.
Now, you can use PowerShell with administrative privileges. Also, you can type any PowerShell commands to perform various tasks. Whenever you want to exit the PowerShell, type the “Exit" and after that, press Enter.
10. Using the Control Panel
The Control Panel of Windows is a software that provides different tools for you to manage your system settings. You can use it to access and open most applications in your system. To do that, follow these simple steps, and then you’ll have Windows PowerShell with administrative privileges:
- Open Control Panel: You can locate the control panel in the Start menu. Also, you can search for it.
- Go to System and Security: Select this option named "System and Security"
- Find Windows Tools: Scroll down and find "Windows Tools". Then, choose it.
- Right-click on Windows PowerShell: Select "Run as an administrator".
- Confirm permission: When prompted, click yes.
Now, you’re able to run any commands with full admin privileges.
11. Using a Desktop Shortcut
Do you want to save time especially if you always run commands that need administrative access? So, you can create a desktop shortcut for Windows PowerShell and save time. To set it up, follow these steps:
- First, right-click on your desktop. In the displayed options, choose “New > Shortcut”.
- Now, go to the "Create Shortcut" window and enter this path:
`C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe`
- After that, click “Next” to proceed.
- In the last step, choose a name for your shortcut and then click “Finish”.
- Now you can open PowerShell as an administrator only by double-clicking the shortcut.
12. Open Windows PowerShell as an Administrator Using a Batch File
You can open Windows PowerShell as an administrator by creating a batch file. In this section, we tell you how to do that:
- Open Notepad: To open Notepad, you can press Windows key + R, type "Notepad" and then pressing the Enter key.
- Copy and paste: In the Notepad, paste this: Powershell.exe -Command "& {Start-Process Powershell.exe -Verb RunAs}"
- Save as: After pasting that, you need to save. To do that, go to File -> Save as.
- Name it: Now you should give it a name. you can choose "PowerShell.bat" or any other name you like. Just don’t forget the .bat extension.
- Choose a location: Now choose the place that you’re going to save it.
- Click Save: And finally, click Save to create a shortcut.
Use it: All you need to do to use it, is double-clicking the "PowerShell.bat" file. Then click Yes to allow admin access.
Conclusion
We hope this article has explained how to run PowerShell as administrator or open PowerShell as admin via the above listed 6 ways inside the article. Now, you should not have any problem starting PowerShell with administrative privileges. If you have any questions or suggestions, please leave them in the comment section below.
One OF my major goals is getting new experiences about ICT and what’s more making progress through this field.