- Использование запуска приложения с учетной записи администратора в Windows Server 2003
- Аннотация
- Действия, необходимые для запуска приложения с учетной записи администратора
- Как запускать программы, требующие права администратора, под учетной записью обычного пользователя
- Зачем обычному приложению могут понадобится права администратора
- Запуск программы, требующей права администратора от обычного пользователя
- Переменная окружения __COMPAT_LAYER и параметр RunAsInvoker
- How to set apps to always run as an administrator on Windows 10
- How to always run an app elevated on Windows 10
- More Windows 10 resources
- The Dell XPS 15 is our choice for best 15-inch laptop
- Halo: MCC’s live service elements make it better, not worse
- Microsoft’s Surface Duo is not ‘failing up’
- These are the best PC sticks when you’re on the move
- 13 ways to use “Run as administrator” in Windows 10
- First things first: About UAC and Run as administrator
- 1. Run a program as admin from the contextual menu of its Start Menu shortcut or tile
- 2. Run as administrator using “Ctrl + Shift + Click” on its Start Menu shortcut or tile
- 3. Run a program as administrator from its desktop shortcut
- 4. Run a desktop app as administrator from its taskbar shortcut
- 5. Run a program as administrator from its right-click menu
- 6. Use “Run as administrator” from File Explorer’s ribbon
- 7. Run a desktop app as admin from the Search window
- 8. Run a program as administrator using “Ctrl + Shift + Enter” on its taskbar search result
- 9. Run a program as administrator from the Run window
- 10. Run as admin from the Task Manager
- 11. Run a desktop app as admin using the RunAs command in Command Prompt (CMD) or PowerShell
- 12. Always run a program with administrator permissions
- 13. Run a program with administrator permissions and without a UAC prompt
- Which method(s) do you plan to use?
Использование запуска приложения с учетной записи администратора в Windows Server 2003
В этой статье описывается использование команды для запуска Run as приложения в качестве администратора.
Исходная версия продукта: Windows Server 2003
Исходный номер КБ: 325362
Аннотация
Можно использовать для запуска приложения в качестве администратора, если вы хотите выполнять административные задачи при входе в систему в качестве члена другой группы, например «Пользователи» или Run as «Power Users».
Действия, необходимые для запуска приложения с учетной записи администратора
Чтобы запустить Run as приложение в качестве администратора, выполните следующие действия.
- Найдите приложение, которое нужно запустить в проводнике Windows, консоли управления (MMC) или панели управления.
- Нажимайте и удерживайте клавишу SHIFT, щелкнув правой кнопкой мыши исполняемый файл или значок приложения, а затем выберите «Запустить как».
- Выберите следующего пользователя.
- В полях «Имя пользователя»и «Пароль» введите учетную запись администратора и пароль, а затем выберите «ОК».
- Некоторые приложения могут не поддерживать использование Run as команды.
- Возможно, вы не сможете запустить приложение, консоль MMC или средство панели управления из сетевого расположения с помощью команды, если учетные данные, используемые для подключения к сетевой сети, отличаются от учетных данных, используемых для запуска Run as приложения. Учетные данные, используемые для запуска приложения, могут не разрешить доступ к одной сетевой сети.
- Вы также можете использовать Run as команду из командной строки. Для получения дополнительных сведений выберите «Начните» и выберите «Выполнить». В поле «Открыть» введите cmd и выберите «ОК». В командной подсказке введите runas /?, а затем нажмите ввод.
Как запускать программы, требующие права администратора, под учетной записью обычного пользователя
Многие программы при запуске требуют повышения прав (значок щита у иконки), однако на самом деле для их нормальной работы прав администратора не требуется (например, вы вручную предоставили необходимые права пользователям на каталог программы в ProgramFiles и ветки реестра, которые используются программой). Соответственно, при запуске такой программы из-под простого пользователя, если на компьютере включен контроль учетных записей, появится запрос UAC и от пользователя потребует ввести пароль администратора. Чтобы обойти этот механизм многие просто отключают UAC или предоставляют пользователю права администратора на компьютере, добавляя его в группу локальных администраторов. Естественно, оба этих способа небезопасны.
Зачем обычному приложению могут понадобится права администратора
Права администратора могут потребоваться программе для модификации неких файлов (логи, конфигурации и т.д.) в собственной папке в C:\Program Files (x86)\SomeApp). По умолчанию у пользователей нет прав на редактирование данного каталога, соответственно, для нормальной работы такой программы нужны права администратора. Чтобы решить эту проблему, нужно под администратором на уровне NTFS вручную назначить на папку с программой право на изменение/запись для пользователя (или группы Users).
Примечание . На самом деле практика хранения изменяющихся данных приложения в собственном каталоге в C:\Program Files неверна. Правильнее хранить данные приложения в профиле пользователя. Но это вопрос уже о лени и некомпетентности разработчиков.
Запуск программы, требующей права администратора от обычного пользователя
Ранее мы уже описывали, как можно отключить запрос UAC для конкретной программы , с помощью параметра RunAsInvoker. Однако этот метод недостаточно гибкий. Также можно воспользоваться RunAs с сохранением пароля админа /SAVECRED (также небезопасно). Рассмотрим более простой способ принудительного запуска любой программы без прав администратора (и без ввода пароля админа) при включенном UAC (4,3 или 2 уровень ползунка UAC ).
Для примера возьмем утилиту редактирования реестра — regedit.exe (она находится в каталоге C:\windows\system32). При запуске regedit.exe появляется окно UAC и, если не подтвердить повышение привилегии, редактор реестра не запускается.
Создадим на рабочем столе файл run-as-non-admin.bat со следующим текстом:
cmd /min /C «set __COMPAT_LAYER=RUNASINVOKER && start «» %1″
Теперь для принудительного запуска приложения без права администратора и подавления запроса UAC, просто перетащите нужный exe файл на этот bat файл на рабочем столе.
После этого редактор реестра должен запустится без появления запроса UAC. Открыв диспетчер процессов, и добавим столбец Elevated (С более высоким уровнем разрешений), вы увидите, что в системе имеется процесс regedit.exe с неповышенным статусом (запущен с правами пользователя).
Попробуйте отредактировать любой параметр в ветке HKLM. Как вы видите доступ на редактирование реестра в этой ветке запрещен (у данного пользователя нет прав на запись в системные ветки реестра). Но вы можете добавлять и редактировать ключи в собственной ветке реестра пользователя — HKCU.
Аналогичным образом можно запускать через bat файл и конкретное приложение, достаточно указать путь к исполняемому файлу.
Set ApplicationPath=»C:\Program Files\MyApp\testapp.exe»
cmd /min /C «set __COMPAT_LAYER=RUNASINVOKER && start «» %ApplicationPath%»
Также можно добавить контекстное меню, которое добавляет у всех приложений возможность запуска без повышения прав. Для этого создайте следующий reg файл и импортируйте его в реестр.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
@=»Run as user without UAC elevation»
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
@=»cmd /min /C \»set __COMPAT_LAYER=RUNASINVOKER && start \»\» \»%1\»\»»
После этого для запуска любого приложения без прав админа достаточно выбрать пункт « Run as user without UAC elevation » в контекстном меню.
Переменная окружения __COMPAT_LAYER и параметр RunAsInvoker
Переменная окружения __COMPAT_LAYER позволяет устанавливать различные уровни совместимости для приложений (вкладка Совместимость в свойствах exe файла). С помощью этой переменной можно указать настройки совместимости, с которыми нужно запускать программу. Например, для запуска приложения в режиме совместимости с Windows 7 и разрешением 640×480, установите:
set __COMPAT_LAYER=Win7RTM 640×480
Из интересных нам опций переменной __COMPAT_LAYER выделим следующие параметры:
- RunAsInvoker — запуск приложения с привилегиями родительского процесса без запроса UAC.
- RunAsHighest — запуск приложения с максимальными правами, доступными пользователю (запрос UAC появляется если у пользователя есть права администратора).
- RunAsAdmin — запуск приложение с правами администратора (запрос AUC появляется всегда).
Т.е. параметр RunAsInvoker не предоставляет права администратора, а только блокирует появления окна UAC.
How to set apps to always run as an administrator on Windows 10
On Windows 10, sometimes you have to run programs as an administrator to access advanced functionalities to change system settings. For instance, if you work with Command Prompt or PowerShell, you may need to run them with elevated privileges to execute most commands.
If you use applications that require elevation in the daily basis, you’ve probably noticed that they don’t run with the highest privileges by default. Instead, you have to access the right-click context menu or use other methods to run the program as an administrator. It’s not a complicated process, but if it’s an app that you use regularly, the extra steps can get in the way pretty quickly.
Luckily, it’s possible to configure an app to always run as an administrator to save some unnecessary steps.
In this Windows 10 guide, we’ll walk you through the easy steps to configure program shortcuts to run with elevated privileges.
How to always run an app elevated on Windows 10
To set a particular application to always run as an administrator, use these steps:
- Open Start.
- Search for the app that you want to run elevated.
Right-click the top result, and select Open file location.
Quick Tip: If you’re running the October 2018 Update, as you search, you can click the Open file location option on the list of actions that appears on the right.
Right-click the app shortcut and select Properties.
Click the Advanced button.
Check the Run as administrator option.
Once you’ve completed the steps, every time that you start the app, it’ll run with elevated privileges. Of course, if you’re using the default User Account Control Settings (recommended), you’ll still need to approve the UAC dialog to continue with the application.
At any time, you can revert the changes with the same instructions, but on step No.7, make sure to clear the Run as administrator option.
Although we’re focusing this guide on Windows 10, you can use the same instructions to always run apps as an administrator on Windows 8.1, Windows 10, and older versions.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
The Dell XPS 15 is our choice for best 15-inch laptop
For a lot of people, a 15-inch laptop is a perfect size that offers enough screen for multitasking, and in a lot of cases, some extra performance from powerful hardware. We’ve rounded up the best of the best at this size.
Halo: MCC’s live service elements make it better, not worse
Halo: The Master Chief Collection is more popular than ever, but some fans don’t agree with the live service approach 343 Industries has taken with it. Here’s why those elements are, at the end of the day, great for the game and for Halo overall.
Microsoft’s Surface Duo is not ‘failing up’
Microsoft announced this week that it was expanding Surface Duo availability to nine new commercial markets. While Surface Duo is undoubtedly a work in progress, this is not a sign of a disaster. It’s also doesn’t mean that Surface Duo is selling a ton either. Instead, the reason for the expansion is a lot more straightforward.
These are the best PC sticks when you’re on the move
Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!
13 ways to use “Run as administrator” in Windows 10
In Windows 10, knowing how to run programs as administrator is very important. By default, apps and games in Windows 10 run without administrator permissions, to prevent unauthorized changes to your system. However, there are times when some programs require administrator permissions to work properly or to run specific commands. Windows 10 offers you the ability to run programs as admin without having to disable anything. Here are all the methods to use “Run as administrator” on any desktop app in Windows 10:
First things first: About UAC and Run as administrator
In early versions of Windows, applications had system-wide privileges, which was a security risk. All of Microsoft’s operating systems from Windows Vista onward, including Windows 10, include UAC or User Account Control, a security feature that prevents unauthorized changes to the operating system. Trying to run an application as administrator is one of the changes that require administrative privileges. Before the selected program is launched, a UAC prompt is triggered, asking for permission. If you run the application from an account without administrator permissions, the UAC prompt asks you to enter an administrator password. Without the admin password, the program does not launch.
In Windows 10, you can only run a program with administrator permissions if it is a desktop app. Some of these applications, like security software, cannot run correctly without having administrative permissions. Windows apps that are installed from the Microsoft Store cannot be run with administrative privileges in Windows 10. Furthermore, they have the same level of permissions as a normal user account, so they are not allowed to make changes to advanced system settings or the Windows Registry.
You can learn more about the difference between desktop apps and UWP apps and figure out which ones you can “Run as administrator” by reading What is a Windows app? How is it different from a desktop app or a program?.
1. Run a program as admin from the contextual menu of its Start Menu shortcut or tile
In Windows 10, you can launch a program with administrative permissions by using the contextual menu of its Start Menu shortcut. First, open the Start Menu. Then, find the shortcut of the program you want to launch in the All apps list, and right-click or press-and-hold on it to open a contextual menu. Click, tap, or hover over the More option, and then click or tap on “Run as administrator.“
If you have a tile for your desktop app available in the Start Menu, right-click or press-and-hold on it to open a contextual menu. Access More and then click or tap on “Run as administrator.“
2. Run as administrator using “Ctrl + Shift + Click” on its Start Menu shortcut or tile
Open the Start Menu and locate the shortcut of the program you want to launch as administrator. Hold down both the Ctrl and the Shift keys on your keyboard and then click or tap on that program’s shortcut.
You can also use the “Ctrl + Shift + Click/Tap” shortcut on an app’s Start Menu tile to run it with administrator permissions in Windows 10.
During our tests, this method did not work every time, so if that is the case for you, either try again or consider running the app as administrator another way.
3. Run a program as administrator from its desktop shortcut
Find the desktop shortcut for the program you want to run as admin or create one yourself. Then, right-click or press-and-hold on it to open a contextual menu. Click or tap on the “Run as administrator” option.
4. Run a desktop app as administrator from its taskbar shortcut
In Windows 10, you can also run a desktop app with administrator permissions from its taskbar shortcut. Right-click or press-and-hold on the shortcut, and then right-click or press-and-hold again on the program’s name. Then, from the menu that opens, choose “Run as administrator.”
You can also use the “Ctrl + Shift + Click/Tap” shortcut on an app’s taskbar shortcut to run it with administrator permissions in Windows 10.
5. Run a program as administrator from its right-click menu
Although easier to find, shortcuts are not the only way to run a program as administrator in Windows 10. You can perform the same action from the main executable file’s contextual menu.
Open File Explorer and find the desktop app’s executable. Right-click or press-and-hold on it to open the contextual menu, and then click or tap on “Run as administrator.“
6. Use “Run as administrator” from File Explorer’s ribbon
Find the program’s main executable in File Explorer. Select it, and then click or tap on the Manage tab from the ribbon.
The option you need is displayed in the Run section of Application Tools. Click or tap on the upper half of the “Run as administrator” button to give the selected app admin permissions.
As an alternative, you can also press the lower half of the “Run as administrator” button and then click or tap on the “Run as administrator” option from the drop-down menu.
7. Run a desktop app as admin from the Search window
In the taskbar search field, type in the name of the program that needs to run with administrator permissions. Then, click or tap on the “Run as administrator” option displayed on the right side of the Search window.
Obviously, when you see the UAC prompt asking for permission to run the app as admin, click or tap Yes.
8. Run a program as administrator using “Ctrl + Shift + Enter” on its taskbar search result
Type the name of the program in your taskbar’s search field. If there are multiple results, use the arrow keys on your keyboard to highlight the program you want to run as administrator. Then, simultaneously press the Ctrl + Shift + Enter keys on your keyboard.
9. Run a program as administrator from the Run window
Open the Run window and type in the name of the executable for the program you want to run as administrator. Then hold down the Ctrl and Shift keys on your keyboard and click or tap on OK.
Alternatively, after typing in the name of the program’s main executable, press the Ctrl + Shift + Enter keys on your keyboard at the same time.
10. Run as admin from the Task Manager
Another way to launch a program as administrator in Windows 10 is to start it using the Task Manager. To begin, open the Task Manager. Then, if it opens up in its compact view, click or tap on the More details button.
In the expanded Task Manager, open the File menu and click or tap on “Run new task.“
This opens the “Create new task” window. You can use its Open field to enter the path to the program you want to launch as administrator, or you can click or tap on Browse to navigate to it. Then, make sure to check the “Create this task with administrative privileges.” option and click or tap on OK.
TIP: An advantage of using this method to launch programs as administrator is that you skip the UAC part of the process. That is because the app automatically inherits the permissions of the Task Manager – in our case, administrator permissions – so all you have to do is check the box to enable the option, as seen above. The option is missing if you only have standard user permissions on the device.
11. Run a desktop app as admin using the RunAs command in Command Prompt (CMD) or PowerShell
If the command line is your favorite way of asking your computer to do what you want, you can also access Command Prompt or PowerShell to run a program as administrator. Enter the following command in the CMD or PowerShell window, adjusting it to fit your needs:
runas /user:”your_computer_name\administrator_name” “C:\path\program.exe”
Replace your_computer_name with your computer’s name, administrator_name with the name of a user account that is an administrator on your system, and C:\path\program.exe with the complete path to the program that you want to run as administrator.
As seen in the image below, if you enter the command correctly, you are also asked to enter the administrator’s password. Then, press Enter on your keyboard once again.
TIP: Using this method to launch programs as administrators, you skip the UAC part of the process.
12. Always run a program with administrator permissions
To avoid constantly having to use the methods illustrated above on desktop apps accessed on a regular basis, you can set a program to always run with administrator permissions.
First, open File Explorer and find the main executable of the program you want to run. Right-click or press and hold on it to open the contextual menu. Then, click or tap on Properties.
In the Properties window, go to the Compatibility tab. At the bottom of the window, check the box next to the “Run this program as an administrator” option, and then click or tap on Apply or OK.
This setting is applied, and, from now on, the program always runs with administrator permissions. Follow the same steps if you want to disable the option. You can also edit the Properties of a program’s shortcut to avoid tampering with its main executable. To begin, right-click or press-and-hold on a program’s shortcut to access its contextual menu, and click or tap on Properties.
Then, in the shortcut’s Properties window, select the Shortcut tab. Click or tap on the Advanced button to open Advanced Properties.
In the Advanced Properties window, check the box next to “Run as administrator” and then click or tap OK.
Finally, you are returned to the Properties window, where you have to click or tap on OK or Apply, and you are done.
The settings are applied, and your program works with administrative permissions as long as you open it using the same shortcut. When you use the methods in this section, the UAC prompts you as soon as you try to launch the app.
13. Run a program with administrator permissions and without a UAC prompt
Using the Task Scheduler, you can run a program as administrator without being prompted by the UAC (User Account Control) every time. It is simple, and you don’t have to disable UAC, thus compromising Windows 10’s security. We put together a detailed step by step guide to help you: Use the Windows Task Scheduler to run apps without UAC prompts and admin rights.
Which method(s) do you plan to use?
In Windows 10, there are fewer apps that need to run with administrator permissions than in older versions of Windows. However, a few legitimate programs still require elevated privileges. The main thing to remember is that even if you are logged in with an administrator account, you regularly run apps as a standard user. This means that if you need to run a program that requires administrator permissions, you can just use one of the methods described above and then approve it in the UAC prompt. Which of the method(s) illustrated do you plan to use? Did you already use some of them? Let us know in a comment.