Whether you’re just starting out with PowerShell or you already know how to run commands, there are times when you must use PowerShell to ‘run as administrator’ Why? Because sometimes, any activity you do inside of PowerShell will require elevated privileges.
In this tutorial, you’re going to learn just about every way possible to run PowerShell as administrator from the perspective of an end-user, a command-line junkie, or an IT admin!
This tutorial has many sections each showcasing how to run PowerShell as administrator. Feel free to click on whichever method you prefer in the Table of Contents.
Prerequisites
This article will be a hands-on tutorial. If you’d like to follow along, please be sure you have:
- A Windows 10 PC – Although Windows 10 was used as an example for this article, most of the methods provided will work with Windows 7+.
- An account with administrator privileges. If you don’t already have one, learn how to create one here.
- PowerShell – Most of these methods will work with Windows PowerShell 5.1 or PowerShell 7.
Running PowerShell as Administrator with a Right-Click
One of the simplest ways to run PowerShell as administrator is with a right-click. There are a few different areas where you can right click on PowerShell and run it. Let’s run through them.
Using the Search Bar
The Search Bar is practically one of the easiest ways to run most of the programs installed on your computer. It’s also an easy way to run any program as administrator, including PowerShell.
To run PowerShell, specifically, as administrator from the search bar:
- Click on the search box at the taskbar and type powershell. This action will bring up the PowerShell edition of your preference.
- Look for Windows PowerShell or just PowerShell, if using PowerShell Core, from the search result.
- Right-click on the menu item and select Run as administrator.
You can see these steps demonstrated in the screenshot below.
If you pin a program to the start menu or taskbar, you can also right-click on the menu item there as well. With this method, Windows 10 creates a shortcut for PowerShell that is more accessible to you at the start menu or the taskbar.
To run PowerShell as administrator on a pinned item:
- Find the PowerShell icon in the search box again.
- Right-click on the PowerShell icon and select Pin to Start or Pin to Taskbar.
- Click on the Start button
- Look for Windows PowerShell (or PowerShell Core) on the right side of the Start Menu.
- Right-click on the menu item and choose Run as administrator.
Running PowerShell as Administrator Using File Explorer
Are you in Windows’ File Explorer, you can fire up PowerShell as administrator there too!
- Open up File Explorer by using Win Key + E shortcut keys or by simply clicking the icon at the taskbar as you can see on the screenshot below.
2. Once in File Explorer, click on File → Open Windows PowerShell → Open Windows PowerShell as administrator as shown below.
Using the PowerShell Executable
Whether you’re using a 32-bit or 64-bit operating system, you can run PowerShell as administrator from its respective location.
- In File Explorer, navigate to one of the folders below.
- For 32-bit OS: C:\Windows\System32\WindowsPowerShell\v1.0
- For 64-bit OS: C:\Windows\SysWOW64\WindowsPowerShell\v1.0
- Find the powershell.exe file.
- Right-click on powershel.exe and select Run as Adminstrator.
Creating a Shortcut for PowerShell on the Desktop
If you’d like an easy way to invoke PowerShell, you can also create a Windows shortcut for it.
- Once you’ve got the Create Shortcut process started, provide the path to the PowerShell executable. For Windows PowerShell, that path is:
- For 32-bit OS: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
- For 64-bit OS: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
2. Provide the shortcut a handy name (PowerShell Admin for example).
3. Find the shortcut you just created and right-click on it and choose Properties as shown below.
4. Click on Shortcut tab and then on the Advanced button and the Advanced Properties window will pop-up.
5. In the Advanced Properties window, select the Run as administrator checkbox and click OK.
6. Back to the Shortcut Properties, click OK to apply the changes and you’re all set.
Another way to easily access PowerShell is via the Win-X menu as shown in the following screenshot. This menu was never given an official name but was widely referred to as Win-X (or power user menu) as the shortcut to access it is Win Key + X.
Once the menu is up, simply click on Windows PowerShell (Admin) and you’re off to th races.
Using the Run Command Window
The Run Command Window is a powerful tool that lets you run programs without searching for them using the SearchBar, Start Menu or File Explorer. To run PowerShell as administrator via the Run command window:
- Press Win Key + R. A a small window will pop up as shown in the screenshot below.
- Type in powershell and press Ctrl+Shift+Enter or press and hold Ctrl+Shift.
- Click OK to make PowerShell run as administrator.
You’re now running PowerShell as administrator.
Using Task Manager
Task Manager is a tool that lets you monitor or end a process of the programs and services that are currently running on your computer. You can also use it to execute a task such as running PowerShell as administrator manually.
To run PowerShell as administrator via the task manager:
- Open the Task Manager by pressing Ctrl+Shift+Esc keys on your keyboard or as you see in the screenshot below
You can alternatively right-click on the Task Bar and select Task Manager to bring up Task Manager.
2. Once Task Manager opens, go up to File and click on Run new task as shown below.
3. You should then see a window pop up that looks similar to the Run window described earlier.
4. Type in powershell ensuring you also check the Create this task with administrative privileges checkbox and click OK to make PowerShell run as administrator.
Running PowerShell as Administrator with the Command Line
If you regularly find yourself on the command line, don’t fret, you can run PowerShell as administrator there too!
If you already have cmd. exe open running as adminstrator using the same techniques described in this article, you can simply run start powershell and it will be running as adminstrator.
If you’re running a command prompt not as administrator yet, that’s not a problem. Invoke the Start-Process cmdlet with PowerShell from cmd. exe using the -Verb runas parameter.
powershell Start-Process powershell -Verb runAs
If you’re already in a PowerShell window, you can run Start-Process powershell -Verb runas directly to open a new PowerShell instance running as administrator
Creating a Batch File to Run PowerShell as Administrator
So you now know how to invoke PowerShell as administrator from a command prompt. If you already know how to do that, you can create a batch file to automate it!
Open up your favorite text editor, paste in the following line and save the file as PowerShell as admin.bat anywhere you’d like.
Powershell.exe -Command "& {Start-Process Powershell.exe -Verb RunAs}"
Run the batch file and you’ll notice up comes a PowerShell window running as administrator!
Creating a Scheduled Task to Run PowerShell as Administrator
Task Scheduler is a built-in app on Windows 10 that lets you virtually run automated tasks. Hence, you can also use it to create a task that runs PowerShell as administrator each time you logon to your computer, for example.
Start up the Create Taskbox and specify the file to run as one of the below:
- For 32-bit OS: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
- For 64-bit OS: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
In the Create Task windows, provide the values to all of the menu items shown below ensuring the Run with highest privileges checkbox is checked.
Now when the scheduled task is invoked, it will execute PowerShell as administrator!
Further Reading
- PowerShell Objects, Properties and Methods
- How to Set Up and Manage Scheduled Tasks with PowerShell
Многие инструкции на этом сайте в качестве одного из первых шагов предлагают запустить PowerShell, обычно от имени администратора. Иногда в комментариях появляется от начинающих пользователей вопрос о том, как это сделать.
В этом руководстве подробно о способах открыть PowerShell, в том числе от администратора, в Windows 10, 8 и Windows 7, а также видео инструкция, где все эти способы показаны наглядно. Также может быть полезно: Способы открыть командную строку от имени администратора.
Запуск Windows PowerShell с помощью поиска
Моя первая рекомендация на тему запуска любой утилиты Windows, которую вы не знаете, как запустить — использовать поиск, он поможет почти всегда.
Кнопка поиска есть на панели задач Windows 10, в Windows 8 и 8.1 поле поиска можно открыть клавишами Win+S, а в Windows 7 найти в меню «Пуск». Шаги (на примере 10-ки) будут следующими.
- В поиск начните вводить PowerShell, пока не покажется необходимый результат.
- Если требуется запуск от имени администратора, нажмите по Windows PowerShell правой кнопкой мыши и выберите соответствующий пункт контекстного меню.
Как видите, очень просто и подходит для любой из последних версий Windows.
Как открыть PowerShell через контекстное меню кнопки «Пуск» в Windows 10
Если на вашем компьютере установлена Windows 10, то, пожалуй, ещё более быстрый способ открыть PowerShell — нажать правой кнопкой мыши по кнопке «Пуск» и выбрать нужный пункт меню (там присутствует сразу два пункта — для простого запуска и от имени администратора). Это же меню можно вызвать, нажав клавиши Win+X на клавиатуре.
Примечание: если в этом меню вместо Windows PowerShell у вас отображается командная строка, то заменить её на PowerShell вы, при желании, можете в Параметры — Персонализация — Панель задач, включив пункт «Заменить командную строку оболочкой Windows Powershell» (в последних версиях Windows 10 параметр включен по умолчанию).
Запуск PowerShell с помощью диалогового окна «Выполнить»
Еще один простой способ запуска PowerShell — использовать окно «Выполнить»:
- Нажмите клавиши Win+R на клавиатуре.
- Введите powershell и нажмите Enter или Ок.
При этом в Windows 7 можно установить отметку запуска от имени администратора, а в последней версии Windows 10, если при нажатии Enter или Ok удерживать клавиши Ctrl + Shift, то утилита также запуститься от имени администратора.
Видео инструкция
Другие способы открыть PowerShell
Выше перечислены далеко не все способы открытия Windows PowerShell, но, уверен, что их будет вполне достаточно. Если же нет, то:
Также, бывает, спрашивают, а что такое PowerShell ISE и PowerShell x86, которые находятся, например, при использовании первого способа. Отвечаю: PowerShell ISE — «Интегрированная среда сценариев PowerShell». По сути, с её помощью можно выполнять все те же команды, но, помимо этого, в ней присутствуют дополнительные возможности, облегчающие работу со скриптами PowerShell (справка, инструменты отладки, цветовая разметка, дополнительные горячие клавиши и т.п.). В свою очередь версии x86 нужны в случае, если вы работаете с 32-битными объектами или с удаленной системой x86.
Nowadays, most users are aware of the Command Prompt that is present in all versions of Windows. Undoubtedly this is one of the most dominant tools on the Windows Operating System. However, Windows supports another powerful application, PowerShell, to perform a wide range of operations. Just sign in as an Administrator and you may run PowerShell to handle configuration and carry out task automation.
PowerShell is a task-based mechanization and a fully developed scripting tool that can accelerate the admin job. It instructs users to manage the device from the command line. In other words, you can say that PowerShell is an advanced form of CMD. Therefore in the coming days, it is quite possible that this tool can take the place of a command prompt. So here are the five easy methods by following you can Open PowerShell as an administrator in Windows 10.
6 Ways to open PowerShell as Admin on Windows 10
Here is how to open Windows PowerShell with admin rights on your computer –
1. Using Cortana or the Search bar
You can open this tool using the Search (Win + S) bar available on the Taskbar. Here’s what you need to do –
- Click on Cortana and type PowerShell.
- Look for the option “Run as Administrator” on the right pane and click on it.
- The User Account Control window will prompt next, hit Yes to authorize opening it.
- When Windows PowerShell starts, you may run whichever command you want to execute on your PC.
2. Using Run Command
- Press the Win + R hotkey to open the Run dialog box.
- Type PowerShell and click OK.
Note: Windows PowerShell will open in normal mode.
- Type the command Start-Process Powershell -verb runAs and press the Enter key.
- Its interface will switch to administrator mode.
- There will be a confirmation line regarding this request.
- Type Y and hit Enter to confirm this action.
3. By using the Command Prompt
- Press Win + S, and type Command Prompt.
- Right-click on the result and select Run as administrator.
- Provide permission on the UAC window by clicking Yes.
- On the running Window, type PowerShell and hit Enter.
- Well, the default structure on CMD will now change to the PowerShell way. You may see the Snapshot above.
4. By using the Power menu
This method will only work if you haven’t changed Windows PowerShell to Command Prompt sometime back on your PC. Let’s see how to open PowerShell using the Power Menu (Win + X) –
- Right-click on the Start button.
- Click on Windows PowerShell (Admin).
5. By using Task Manager
- Initially open the Task Manager by pressing ctrl + shift + Esc.
- Click on File, available in the top-left corner of the wizard.
- Hit the Run new task option.
- Now, type PowerShell in the void box and tick the checkbox below the void space.
6. By using the Start Menu
- Click on the start button; scroll down the menu list.
- Explore the drop-down menu in the Windows PowerShell folder.
- Now select this folder and it will expand.
- Right-click on the Windows PowerShell option and select Run as Administrator.
I hope you find this guide useful and all six methods also work on your computer. Let us know in the comment section if any method doesn’t work.
That would be all!
Like Command Prompt, Windows PowerShell is a command-line window designed in Windows, which is generally for system advanced administration, IT professionals and developers. Actually, Windows PowerShell is more powerful but less known than Command Prompt. In our previous post, we showed how to open Command Prompt as an administrator in Windows 10. Now in this post, we will show five ways to run PowerShell as an administrator in Windows 10.
- Way 1: from start menu
- Way 2: from Win + X menu
- Way 3: from the command prompt
- Way 4: from File Explorer
- Way 5: from task manager
- Way 6: from the Run dialog
Way 1: Run PowerShell as administrator from Start menu search box
Step 1: Bring up the Windows 10 Start menu.
Step 2: Type powershell. In the search result, right click on the Windows PowerShell app and select Run as administrator.
Way 2: Run PowerShell as admin from Win + X menu
Either Command Prompt or Windows PowerShell has usually included in Win + X menu.
Press Win + X keyboard shortcut to bring up Win + X menu. Then from the menu click Windows PowerShell (Admin).
Way 3: Run PowerShell as administrator from an elevated CMD
Step 1: Open Windows 10 Command Prompt as administrator.
Step 2: Type powershell and hit Enter. Then the command prompt will turn to Windows PowerShell.
Way 4: Run PowerShell as administrator from File Explorer
Step 1: Open File Explorer in Windows 10.
Step 2: Navigate to C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe. Then right-click on the powershell.exe file and select Run as administrator.
Way 5: Run PowerShell as administrator from Task Manager
Step 1: Open Windows 10 task manager.
Step 2: Click on More details in the lower left corner to display the full screen of task manager.
Step 3: Click File > Run new task.
Step 4: In the Create new task dialog box, type powershell, check the box next to Create this task with administrative privileges and then click OK.
Step 1: Bring up Run dialog box by pressing Win + R keys.
Step 2: Type powershell in the box and click OK.
Step 3: A normal Windows PowerShell will open as your current user. Type start –process powershell –verb runAs and hit “Enter” key. This will bring up an elevated PowerShell as an administrator.
Для некоторых важных задач в Windows вам нужно открыть командную строку и запустить ее как администратор. Например, если вы хотите запустить Diskpart, который позволяет вам просматривать, создавать или удалять разделы в командной строке, вам нужно открыть CMD (также известное как приложение командной строки) как администратор. Для некоторых задач вы можете предпочесть PowerShell, который имеет все функции командной строки, но добавляет расширенные возможности сценариев / командлеты.
Когда вы запускаете CMD как администратор, это называется запуском командной строки с повышенными правами, потому что ваши привилегии повышены. Если вы являетесь администратором своего ПК — скорее всего, так и было, если вы купили или собрали свой собственный компьютер — ваш основной пользователь, вероятно, имеет права администратора (если вам выдали корпоративный компьютер на работе или в школе, возможно, нет). Вам просто нужно воспользоваться этими правами, потому что по умолчанию ни командная строка
Интерфейс командной строки (англ. Command line interface, CLI) — способ взаимодействия между человеком и компьютером путём отправки компьютеру команд, представляющих собой последовательность символов. Команды интерпретируются с помощью специального интерпретатора, называемого оболочкой. Интерфейс командной строки противопоставляется системам управления программой на основе меню, а также различным реализациям графического интерфейса. Википедия
, ни PowerShell не запускаются от имени администратора.
Как запустить Cmd от имени администратора с помощью правой кнопки мыши
Самый простой способ запустить любую программу, включая CMD, с правами администратора в Windows 11 или 10 — это найти ее в поиске Windows, затем щелкнуть правой кнопкой мыши по значку и выбрать «Запуск от имени администратора».
Изображение: Tom’s Hardware
Само собой разумеется, что если вы не отключили контроль учетных записей пользователей, Windows выведет диалоговое окно
Диало́говое окно́ (англ. dialog box) в графическом пользовательском интерфейсе — специальный элемент интерфейса, окно, предназначенное для вывода информации и (или) получения ответа от пользователя. Получил своё название потому, что осуществляет двустороннее взаимодействие компьютер-пользователь («диалог»): сообщая пользователю что-то и ожидая от него ответа.
Диалоговые окна подразделяются на модальные и немодальные, в зависимости от того, блокируют ли они возможность взаимодействия пользователя с приложением (или системой в целом) до тех пор, пока не получат от него ответ. Википедия
с вопросом, уверены ли вы, что хотите запустить CMD от имени администратора.
Этот же метод работает для PowerShell или любой другой программы, которую вы хотите. Однако я ненавижу использовать этот метод, потому что он добавляет шаг щелчка правой кнопкой мыши и выбора элемента из контекстного меню. На ноутбуке с жестким или скользким тачпадом вам, возможно, придется несколько раз попытаться щелкнуть правой кнопкой мыши и выбрать Запуск от имени администратора.
Как настроить Cmd для постоянного запуска от имени администратора
Я не могу вспомнить момент, когда я хотел бы запустить командную строку или PowerShell и не запускать их в режиме администратора. К счастью, есть способ сделать так, чтобы каждая программа (или любая программа) запускалась по умолчанию от имени администратора, как только вы нажимаете на ее ярлык. Вот как это сделать для командной строки, но те же шаги сработают и для PowerShell.
1. Найдите «командную строку» или «CMD» в поиске Windows.
2. Щелкните правой кнопкой мыши по верхнему результату и выберите «Открыть расположение файла».
Изображение: Tom’s Hardware
Расположение ярлыка командной строки откроется в проводнике Windows.
3. Щелкните правой кнопкой мыши значок ярлыка командной строки и выберите Свойства.
Изображение: Tom’s Hardware
4. Click Advanced.
Изображение: Tom’s Hardware
5. Установите переключатель «Запуск от имени администратора» в положение «Вкл.» и нажмите «ОК».
Изображение: Tom’s Hardware
6. Нажмите «ОК» в окне свойств командной строки, чтобы закрыть его.
В следующий раз, когда вы выполните поиск по запросу «CMD» или «командная строка» и нажмете на верхний результат, вы получите административную командную строку.
Обратите внимание, что командная строка с повышенными правами, в качестве меры безопасности, всегда будет запускаться в C:\Windows\System32 — поле «Запустить в» ярлыка игнорируется. Если вы хотите запустить командную строку с повышенными правами в другой папке, например C:\Users, вы можете обойти ограничение, передав в командную строку команду смены каталога (или pushd) с помощью параметра /k. Для этого измените Target, включив в него дополнительные параметры, например:
%windir%\system32\cmd.exe /k «pushd C:\Users»
Используйте CTRL + Shift Enter для запуска Cmd от имени администратора.
Допустим, вы хотите запустить командную строку с повышенными правами, но не хотите менять сочетание клавиш
Сочетание клавиш (синонимы: горячая клавиша, шорткат [англ. shortcut], клавиша быстрого доступа, клавиша быстрого вызова, клавиатурный ускоритель; англ. keyboard shortcut, quick key, access key, hot key) (для программного обеспечения) — разновидность интерфейса взаимодействия с вычислительным устройством (компьютером, калькулятором), представляющая собой нажатие кнопки/клавиши (или сочетания клавиш) на клавиатуре, которому назначено (запрограммировано) некое действие — команды (операции), исполняемые данной системой. Как правило, частично дублирует интерфейс меню или кнопок и служит для значительного ускорения работы, также — увеличения количества возможных действий, выполняемых с помощью клавиатуры. Википедия
командной строки, чтобы это происходило каждый раз. Нет проблем. Вы можете использовать сочетание клавиш Ctrl + Shift + Enter, когда выбираете значок командной строки в меню «Пуск» или даже когда запускаете CMD из диалогового окна «Выполнить».
Чтобы использовать диалоговое окно «Выполнить» для запуска cmd от имени администратора:
1. Нажмите сочетание клавиш Windows + R, чтобы открыть диалоговое окно «Выполнить».
2. Введите cmd в диалоговое окно «Выполнить».
Изображение: Tom’s Hardware
3. Нажмите Ctrl + Shift + Enter.
Используйте контекстное меню Windows + X для запуска PowerShell от имени администратора
Этот метод работает только для PowerShell, но, как мы уже говорили, PowerShell может делать все то же, что и CMD, и даже больше.
1. Нажмите клавиши Windows + X. На рабочем столе появится длинное контекстное меню.
2. Выберите Терминал (администратор)
Изображение: Tom’s Hardware
Откроется окно PowerShell с правами администратора.
Источник: Tomshardware.com