- Как запускать программы, требующие права администратора, под учетной записью обычного пользователя
- Зачем обычному приложению могут понадобится права администратора
- Запуск программы, требующей права администратора от обычного пользователя
- Переменная окружения __COMPAT_LAYER и параметр RunAsInvoker
- You must be an administrator to install windows
- Answered by:
- Question
- Answers
- You must be logged on as an administrator to install this update. Update has been cancelled. (9999)
- You must be an administrator to install windows
- Error message: «you must have administrator privilidges to install drivers» — but I AM the administrator
Как запускать программы, требующие права администратора, под учетной записью обычного пользователя
Многие программы при запуске требуют повышения прав (значок щита у иконки), однако на самом деле для их нормальной работы прав администратора не требуется (например, вы вручную предоставили необходимые права пользователям на каталог программы в 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.
You must be an administrator to install windows
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
Ive tried adding the users domain account to the local power users group but that still hasn’t fixed the issue. The users get this error when attmpeting to install anything on the local computer.
Answers
Thanks for the post!
Try to take the owernership of this program then install it. Follow these steps:
1. Right-click the file, choose Properties, click Security Tab.
2. Click Advanced — Owner Tab — click Edit (you may asked for elevated privileage)
3. If the user is not listed, Click Other users or groups and add the user.
Now reinstall the program to check if it works.
This posting is provided «AS IS» with no warranties, and confers no rights. | Please remember to click «Mark as Answer» on the post that helps you, and to click «Unmark as Answer» if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
You must be logged on as an administrator to install this update. Update has been cancelled. (9999)
I received error message you must be logged on as an administrator to install this update. Update has been cancelled. (9999) despite the fact that I am logged in as an administrator.
This occurred after I replaced my hard drive without a recovery cd. Loaded Windows XP, SP2 and SP3 and received error while attempting to install drivers from a flash drive.
Thank you for posting in Microsoft Community.
Before starting the troubleshooting steps, I need the required information.
1. Is it Windows is activated?
2. Did you receive any error when installing Windows update or when installing drivers from a flash drive?
I would suggest you to refer the link and check.
You receive an «Administrators only» error message when you try to visit the Windows Update Web site or the Microsoft Update Web site
http://support.microsoft.com/kb/316524
If the above doesn’t work, I would suggest you to perform clean boot and check.
Place the computer in a clean boot state and then check if it helps. You can start Windows by using a minimal set of drivers and startup programs. This kind of startup is known as a «clean boot.» A clean boot helps eliminate software conflicts.
How to configure Windows XP to start in a «clean boot» state
Note: Steps to configure Windows to use a Normal startup state
You must be an administrator to install windows
I did some tests on my machines and it took some time. I apologize for that.
I found the following rights are needed to run sysprep.exe:
•Back up files and directories
•Modify firmware environment values
•Restore files and directories
•Shutdown the system
I got following error message in setuperr.log if one of the rights that are essential for running Sysprep.exe have been removed, even I am already in Administrator account.
2014-12-18 19:49:34, Error [0x0f0053] SYSPRP ValidateUser:User does not have required privileges to sysprep machine
2014-12-18 19:49:34, Error [0x0f00a1] SYSPRP WinMain: you must be an administrator.
2014-12-18 19:49:36, Error [0x0f0053] SYSPRP ValidateUser:User does not have required privileges to sysprep machine
2014-12-18 19:49:36, Error [0x0f00a1] SYSPRP WinMain: you must be an administrator.
Please use the Local Security Settings tool to check the user rights assignments first.
- Click Start, click Run, type secpol.msc, and then click OK.
- In the Local Security Settings window, expand Local Policies, and then double-click User Rights Assignment.
- Look through the list of user rights and verify that the Administrators group has the rights that are needed to run Sysprep.exe.
- If you need to add a right, double-click the right, and then click Add.
- In Select Users or Groups, click Administrator, and then click Add.
Click OK twice to add Administrator to the list of users who have that right.
Note : If the policy that removed the necessary rights from the Administrators group is set at the Domain, Site, or Organizational Unit level, you need to modify the Group Policy of the domain.
Error message: «you must have administrator privilidges to install drivers» — but I AM the administrator
Attempting to install an audio/MIDI interface driver and cannot do it either by disk or by download from the Tascam site. Computer tells me I must have administrator privileges but I am the administrator. Did not have this issue with installing my printer and other things.
Please assist; thanks.
Attempting to install an audio/MIDI interface driver and cannot do it either by disk or by download from the Tascam site. Computer tells me I must have administrator privileges but I am the administrator. Did not have this issue with installing my printer and other things.
Please assist; thanks.
Hi SoundSourceress – Welcome to Microsoft Answers Community.
If you are in Windows Vista® (or Windows® 7), then you are running
with Standard User Token, even if you are in the Administrators Group.
When you right-click an item and left-clickRun as administrator, a UAC-prompt
will appear, select Yes. Then you will get access to the Administrators
Token.
I hope you find this information useful. If you need any further assistance,
please feel free to contact me and let me know.