Windows run app as admin without uac

Многие программы при запуске требуют повышения прав (значок щита у иконки), однако на самом деле для их нормальной работы права администратора не требуется

Многие программы при запуске требуют повышения прав (значок щита у иконки), однако на самом деле для их нормальной работы права администратора не требуется (например, вы можете вручную предоставить необходимые права пользователям на каталог программы в ProgramFiles и ветки реестра, которые используются программой). Соответственно, если на компьютере включен контроль учетных записей, то при запуске такой программы из-под непривилегированного пользователя появится запрос UAC и Windows потребует от пользователя ввести пароль администратора. Чтобы обойти этот механизм многие просто отключают UAC или предоставляют пользователю права администратора на компьютере, добавляя его в группу локальных администраторов. Microsoft не рекомендует использовать такие методы, т.к. это снижает безопасность компьютера.

Содержание:

  • Зачем обычному приложению могут понадобится права администратора?
  • Запуск программы, требующей права администратора, от обычного пользователя
  • RunAsInvoker в переменной окружения __COMPAT_LAYER
  • Включаем режим RunAsInvoker через манифест exe файла программы

Зачем обычному приложению могут понадобится права администратора?

Права администратора могут потребоваться программе для модификации некоторых файлов (логи, файлы конфигурации и т.д.) в собственной папке в C:Program Files (x86)SomeApp). По умолчанию у пользователей нет прав на редактирование данного каталога, соответственно, для нормальной работы такой программы нужны права администратора. Чтобы решить эту проблему, нужно войти на компьютер под администратором и вручную предоставить пользователю (или встроенной группе Users) права на изменение/запись для этого каталога на уровне файловой системы NTFS.

права на запись пользователю в папку программы в ProgramFiles

Примечание. На самом деле практика хранения изменяющихся данных приложения в собственном каталоге в C:Program Files неверна. Правильнее хранить данные приложения в профиле пользователя. Но это уже вопрос о лени и некомпетентности разработчиков программ.

Запуск программы, требующей права администратора, от обычного пользователя

Ранее мы уже описывали, как можно с помощью параметра RunAsInvoker отключить запрос UAC для конкретной программы. Однако этот метод недостаточно гибкий.

Также можно воспользоваться RunAs с сохранением пароля админа
/SAVECRED
в диспетчере паролей Windows (Credentials Manager). Это также небезопасно, т.к. пользователь может использовать сохранённый пароль учетной записи администратора для запуска других программ.

Рассмотрим более простой способ принудительного запуска любой программы без прав администратора (и без ввода пароля админа) при включенном UAC (4,3 или 2 уровень ползунка UAC).

Для примера возьмем утилиту редактирования реестра — regedit.exe (она находится в каталоге C:windows). Обратите внимание на щит UAC у иконки. Данный значок означает, что для запуска этой программы будет запрошено повышение привилегий через UAC.

иконка щита UAC у exe файла в Windows 10

Если запустить
regedit.exe
, то перед вами появится окно User Account Contol с запросом пароля пользователя с правами администратора на этом компьютере (
Do you want to allow this app to make changes to your device?
). Если не указать пароль и не подтвердить повышение привилегии, приложение не запустится.

запрос пароля администратора при запуске программы в windows 10

Попробуем обойти запрос UAC для этой программы. Создайте на рабочем столе файл run-as-non-admin.bat со следующим текстом:

cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"

Теперь для принудительного запуска приложения без прав администратора и подавлением запроса UAC, просто перетащите нужный exe файл на этот bat файл на рабочем столе.

запуск программы в обход UAC и с подавлением запроса пароля администратора

После этого редактор реестра должен запуститься без появления запроса UAC и без ввода пароля администратора. Откройте диспетчер процессов, добавьте столбец Elevated и убедитесь, что в Windows 10 запустился непривилегированный процесс regedit (запущен с правами пользователя).

regedit с правами пользовтеля (Elevated = No)

Попробуйте отредактировать любой параметр в ветке HKEY_LOCAL_MACHINE. Как вы видите доступ на редактирование реестра в этой ветке запрещен (у данного пользователя нет прав на запись в системные ветки реестра). Но вы можете добавлять и редактировать ключи в собственной ветке реестра пользователя — HKEY_CURRENT_USER.

запуск редактора реестра под пользователем

Аналогичным образом через bat файл можно запускать и конкретное приложение, достаточно указать путь к исполняемому файлу.

run-app-as-non-admin.bat

Set ApplicationPath="C:Program FilesMyApptestapp.exe"
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %ApplicationPath%"

Также можно добавить контекстное меню, которое добавляет у всех приложений возможность запуска без повышения прав. Для этого создайте файл runasuser.reg файл, скопируйте в него следующий код, сохраните и импортируйте его в реестр двойным щелчком по reg файлу (понадобятся права администратора).

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*shellforcerunasinvoker]
@="Run as user without UAC elevation"
[HKEY_CLASSES_ROOT*shellforcerunasinvokercommand]
@="cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "%1"""

добавть в file explorer windows 10 пункт запуска программы без запроса UAC

После этого для запуска любого приложения без прав админа достаточно выбрать пункт “Run as user without UAC elevation” в контекстном меню проводника Windows File Explorer.

Run as user without UAC elevation

Еще раз напомню, что использование программы в режиме RUNASINVOKER не позволит вам получить повышенные права для программы. Параметр AsInvoker подавляет сообщает UAC и сообщает программе, что она должна запуститься с правами текущего пользователя и не запрашивать повышение привилегий. Если программе действительно нужны повышенные права для редактирования системных параметров или файлов, она не будет работать или повторно запросит права администратора.

RunAsInvoker в переменной окружения __COMPAT_LAYER

Переменная окружения __COMPAT_LAYER позволяет устанавливать различные уровни совместимости для приложений (вкладка Совместимость в свойствах exe файла). С помощью этой переменной можно указать настройки совместимости, с которыми нужно запускать программу. Например, для запуска приложения в режиме совместимости с Windows 7 и разрешением 640×480, установите:

set __COMPAT_LAYER=Win7RTM 640x480

свойства совместимости программы

Из интересных нам опций переменной __COMPAT_LAYER можно выделить следующие параметры:

  • RunAsInvoker — запуск приложения с привилегиями родительского процесса без запроса UAC;
  • RunAsHighest — запуск приложения с максимальными правами, доступными пользователю (запрос UAC появляется если у пользователя есть права администратора);
  • RunAsAdmin — запуск приложение с правами администратора (запрос AUC появляется всегда).

Следующий код включает режим RUNASINVOKER для текущего процесса и запускает указанную программу:

set __COMPAT_LAYER=RUNASINVOKER

start "" "C:Program FilesMyApptestapp.exe"

Включаем режим RunAsInvoker через манифест exe файла программы

Как мы уже говорили выше, Windows 10 показывает значок щита UAC у программ, которые для запуска требуют повышение привилегий. Это требование разработчики задают при разработке в специальной секции программы — манифесте.

Вы можете отредактировать манифест exe файла программы и отключить требование запускать программу в привилегированном режиме.

Для редактирования манифеста программы можно использовать бесплатную утилиту Resource Hacker. Откройте исполняемый файл программы в Resource Hacker.

В дереве слева перейдите в раздел Manifest и откройте манифест программы.

Обратите внимание на строки:

<requestedPrivileges>
<requestedExecutionLevel          level="requireAdministrator"          uiAccess="false"/>
</requestedPrivileges>

Именно благодаря опции requireAdministrator Windows всегда запускает эту программу с правами администратора.

Измените requireAdministrator на asInvoker и сохраните изменения в exe файле.

resource hacker включитьпараметр asinvoker в manifest exe файла

Обратите внимание, что теперь у иконки программы пропал щит UAC и вы можете запустить ее без запроса прав администратора с привилегиями текущего пользователя.

убрат щит защиты uac у любой программы в windows 10 с помощью манифест файла

Если исполняемый файл программы подписан подписью MS Authenticode (сертификатом Code Signing), то после модификации exe файла он может перестать запускаться или выдавать предупреждение.

В этом случае можно заставить программу использовать внешний файл манифеста. Создайте в каталоге с ехе файлом текстовый файл
app.exe.manifest
(например Autologon.exe.manifest) и скопируйте в него код манифеста из Resource Hacker. Измените requireAdministrator на asInvoker. Сохраните файл.

Чтобы Windows при запуске приложений всегда пробовала использовать внешний файл манифеста, включите специальный параметр реестра:

REG ADD "HKLMSOFTWAREMicrosoftWindowsCurrentVersionSideBySide" /v PreferExternalManifest /t REG_DWORD /d 1 /f

Перезагрузите Windows и убедитесь, что программа использует внешний файл манифеста, в котором указано, что нужно запускаться без прав администратора.

I need one of my .exe to always run as administrator without UAC prompt. My program will be installed with setup, which will have for one time admin rights, and I need to perform such step in this setup that my exe will be always executed as admin without UAC prompt.

I’ve found 2 solutions so far:

1.
Use custom service, which will elevate the program for me.

2.
Use Task Scheduler.

Is there any other solution? Some manifest probably?

Thanks.

asked Mar 21, 2010 at 20:41

Paya's user avatar

PayaPaya

5,0644 gold badges42 silver badges69 bronze badges

1

If it were possible to do this, then UAC would be completely ineffective. The inability of applications to elevate themselves without user consent is the fundamental principle behind UAC.

Aside from already having an elevated process that launches it (i.e. service or task scheduler), the answer is no, it can’t be done.

answered Mar 21, 2010 at 20:47

Aaronaught's user avatar

AaronaughtAaronaught

120k25 gold badges261 silver badges339 bronze badges

13

Of course what you are supposed to do if you want to just drive UI is to use the UI access flag in your manifest (see http://msdn.microsoft.com/en-us/library/ms742884.aspx). If you install your application in a trusted location (e.g. system32) and it is signed (bleh!) then when you run your application it will be elevated to high (for an admin account).

The signing requirement makes it slightly annoying but at least it reduces slightly the attack surface as your code gets run with high integrity but not with an administrator token.

answered Mar 21, 2010 at 23:05

tyranid's user avatar

tyranidtyranid

12.9k1 gold badge32 silver badges34 bronze badges

2

Is there any way that I can force a program that normally requires administrator privileges (via UAC) to run without them? (ie: no UAC prompt and no system-wide access.)

Added: Without modifying the executable itself.


In spite of James’s answer, I have found a few ways that it can almost be done:

  1. By modifying the executable I can remove the trustInfo entry from the manifest (or the manifest entirely, so I can use an external one), allowing the program to start without UAC. Unfortunately this modifies the executable, so it exits shortly after due to an internal checksum test.
  2. By using Process Explorer I can launch it as a Limited User. However this seems to limit it significantly more than I would like (it runs like Protected Mode IE and so can access significantly less than what my standard un-elevated user can).

asked Aug 4, 2010 at 13:49

Andrew Russell's user avatar

Andrew RussellAndrew Russell

1,7453 gold badges12 silver badges11 bronze badges

6

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT*shellforcerunasinvoker]
@="Run without privilege elevation"

[HKEY_CLASSES_ROOT*shellforcerunasinvokercommand]
@="cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "%1"""

Save this text in <name_of_file>.reg and add it to the Windows Registry. (Double-clicking on it should do the trick.)

Afterwards, right-click the app you’d like to run without administrative privileges and select «Run without privilege elevation».

In some cases — small amount 0.1% of programs may ask twice about UAC prompt.

answered Jul 18, 2012 at 15:20

Vom's user avatar

VomVom

9727 silver badges3 bronze badges

12

Save to nonadmin.bat:

cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"

Now you can drag and drop programs to this to run them without admin.

This doesn’t require admin privileges as changing that registry key does. Also you won’t clutter the context menu.

Based on Vom’s answer


Update: Should now work with programs that have spaces in name as well.

answered Oct 2, 2015 at 11:27

Hjulle's user avatar

HjulleHjulle

9527 silver badges18 bronze badges

12

I hope I’m not too late to the party, but I was looking for a similar question and without seeing an answer here I found out that Windows’ builtin RunAscommand, when run as administrator, can do that with /trustlevel switch.

RUNAS /trustlevel:<TrustLevel> program

/showtrustlevels  displays the trust levels that can be used
                  as arguments to /trustlevel.
/trustlevel       <Level> should be one of levels enumerated
                  in /showtrustlevels.

This worked in my case.
Ironically, starting a program explicitly without elevation requires an elevated command prompt. Go figure. :)
I hope it helps you.

answered Jan 5, 2012 at 8:15

Mxx's user avatar

MxxMxx

2,7732 gold badges19 silver badges35 bronze badges

6

If you have a particular application that you want to always run without UAC, you can target it with the Registry (add the text to a REG file and import it into the Registry):

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers]
"C:\example\application.exe"="RunAsInvoker"

Unlike this answer, this solution requires no alternate click or change to user interaction.

Microsoft calls this process adding the RunAsInvoker «Compatibility Shim».

Community's user avatar

answered Sep 9, 2016 at 20:16

palswim's user avatar

palswimpalswim

3,3719 gold badges45 silver badges65 bronze badges

2

If it’s a setup (installation) exe file that is requiring administration privilege, there’s a trick to run it without elevated access:

If the file’s name contains words like setup or install windows forcefully runs it with elevated access even if it doesn’t need elevated access:

enter image description here

If the .exe file has a manifest in it, these heuristics for elevation do not apply.

For example if the manifest indicates that the exe does not need elevation, even including any of these words in the file name won’t make it run as elevated.

Another keyword is patch as stated by Mgamerz in the comments.

This is documented on the UAC (User Account Control) docs:

Installer detection detects setup files, which helps prevent installations from being run without the user’s knowledge and consent.

Installer detection only applies to:

  • 32-bit executable files.

  • Applications without a requested execution level attribute.

  • Interactive processes running as a standard user with UAC enabled.

Before a 32-bit process is created, the following attributes are checked to determine whether it is an installer:

  • The file name includes keywords such as «install,» «setup,» or «update.»

Read mode here: https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/how-user-account-control-works

answered Jan 25, 2019 at 11:54

Shayan's user avatar

ShayanShayan

1,3835 gold badges22 silver badges31 bronze badges

3

While in his question Andrew stated that the following did not quite work:

By modifying the executable I can remove the trustInfo entry from the
manifest (or the manifest entirely, so I can use an external one),
allowing the program to start without UAC. Unfortunately this modifies
the executable, so it exits shortly after due to an internal checksum
test.

I was able to modify an external .manifest file for the software I was using and change

<ms_asmv2:requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

to

<ms_asmv2:requestedExecutionLevel level="asInvoker" uiAccess="false" />

Turns out the software I was using did not really require administrator rights so I was able to run it on a Standard User account without UAC or administrator passwords. Thanks!

answered Jul 21, 2013 at 2:56

Aurimas's user avatar

AurimasAurimas

2242 silver badges4 bronze badges

1

I solved this problem today using the MS application customization toolkit.

I followed the instructions in a tech republic article.

Basically:

1) you get the toolkit from MS here .

2) Click Fix

3) Choose the RunAsInvoker option

4) Right Click the fix and choose Install

0xC0000022L's user avatar

0xC0000022L

6,4179 gold badges46 silver badges80 bronze badges

answered May 18, 2011 at 1:05

user53639's user avatar

user53639user53639

2461 gold badge2 silver badges7 bronze badges

6

There is two ways. You can use RunAs with a standard user name:

RunAs /user:StandardUser C:TempFoo.exe

But you’ll need to enter the user’s password.

Or you can use PsExec from SysInternal, where you can pass the password as an argument:

PsExec -u StandardUser -p secret C:TempFoo.exe

answered Jun 10, 2021 at 10:56

Maxence's user avatar

1

I fixed this problem by going changing the permissions on the folder that contained the program.

I added each user that will run that program and gave them «full control» priviledges. That took care of the problem and I left the «run as admin» unchecked.

I don’t have any security concerns for the users who will be running the program.

slhck's user avatar

slhck

219k68 gold badges591 silver badges578 bronze badges

answered Apr 20, 2012 at 4:28

Tim D's user avatar

Tim DTim D

31 bronze badge

No, if a program requires UAC then it is trying to access something outside of its sandbox. The program will not correctly run without the elevated access.

If you just want to get rid of the notification, you can disable UAC.

Disable UAC on Windows Vista: Start, type «user». Click on «User Accounts». On the window that pops up, click on «User Account Control Settings» and then Turn off UAC.

Disable UAC on Windows 7: Start, type «user». Click on «User Account Control Settings». Drag the choice bar all the way to the bottom to «Never Notify.»

answered Aug 4, 2010 at 14:09

James Watt's user avatar

James WattJames Watt

1,8157 gold badges19 silver badges26 bronze badges

4

Recently, I came across a brilliant tip on how to run programs elevated without getting the User Account Control (UAC) prompt. This can be done without turning off the UAC and hence it does not compromise system security.

You can run apps elevated (as administrator) without getting the UAC elevation prompt when logged in to an administrator account. The trick to bypass UAC is to create a scheduled task (with highest privileges) for each program that you want to run, and then invoke the scheduled task item manually using schtasks.exe. The following instructions apply to all versions of Windows, including Windows 10.

Step 1: Creating a Scheduled Task

  1. Launch Task Scheduler (taskschd.msc)
  2. Right-click Task Scheduler Library category in the left, and choose New Folder
  3. Name the folder as MyApps

  4. Select the MyApps folder
  5. In the Actions pane on the right, click Create Task…

  6. Type a name for the task that you want to create.
  7. Enable the option Run with highest privileges. This is the most important step.
  8. In the Action tab, click New
  9. Click Browse… to select the program (Example: Regedit.exe) you want to run and mention the parameters required if any, for the application. For example, to execute a .reg file, select regedit.exe and mention the parameter as /s filename.reg with the full path.To run Services MMC applet, browse and select MMC.EXE and type services.msc in the Add arguments (optional) field.

    Some of the programs that I use frequently are:

    Application Command-line used
    Services MMC mmc.exe services.msc
    Device Manager mmc.exe devmgmt.msc
    Registry Editor c:windowsregedit.exe
    Admin Command Prompt c:windowssystem32cmd.exe

Step 2: Launching a Scheduled Task item manually

To run a scheduled task item manually, use the schtasks.exe command-line tool that comes with Windows. For example, to launch the Services console task that you already created, use the following command:

SCHTASKS.EXE /RUN /TN MyAppsSERVICESMMC

Note: Where SERVICESMMC is the Taskname (see Fig 1). You’ll need to enclose the task name within double-quotes if the task name contains blank spaces in between. (Example: SCHTASKS.EXE /RUN /TN "Name of the Task")

To launch the Registry Editor task, run the following command:

SCHTASKS.EXE /RUN /TN MyAppsREGEDIT

(If the folder name MyApps is not mentioned, you’ll see the error message ERROR: The system cannot find the file specified when attempting to run the task.)

If you’ve created the Tasks in the Task Scheduler library (without creating a separate folder in Tasks Scheduler), you can simply mention the task name like below:

SCHTASKS.EXE /RUN /TN task_name

Creating desktop shortcuts to run each Task

You can create a desktop shortcut for each scheduled task item you’ve created earlier. Right-click on the Desktop and choose New, Shortcut. Type the command-line (e.g., SCHTASKS.EXE /RUN /TN MyAppsREGEDIT). Mention a name for the shortcut and click Finish.

Run the task minimized

As Schtasks.exe is a console utility, you’ll see the Command Prompt window opening and closing quickly whenever you run the shortcut. So, you may configure the shortcut to run in a minimized window state, in the shortcut properties.

  • Right-click on the shortcut and click Properties.
  • In the Run drop-down options, choose Minimized
  • Click OK.

Note: In the shortcut properties, you may want to click Change Icon and assign an appropriate icon for the shortcut. The icons should be present inside the executable itself, in most cases. For Regedit.exe, browse to Regedit.exe and choose an icon. You may also browse the shell32.dll and imageres.dll files for additional icons.

Here are the shortcuts that I created to launch frequently used programs in my system, and I’ve moved them to the Taskbar Toolbar for easy access. Note that you can also Pin the shortcuts to the Start menu if you wish.

This way you can launch your frequently used programs elevated without getting the User Account Control prompt and without relaxing the security settings of your computer. Note that the above UAC bypass method works only if you’re logged in as administrator and there is no question of privilege escalation issues here.


One small request: If you liked this post, please share this?

One «tiny» share from you would seriously help a lot with the growth of this blog.
Some great suggestions:

  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!

So thank you so much for your support. It won’t take more than 10 seconds of your time. The share buttons are right below. :)


 Windows OS Hub / Windows 10 / How to Run Program without Admin Privileges and to Bypass UAC Prompt?

When started, many programs require permission elevation (shield on the app icon), but actually they don’t need the administrator privileges for their normal operation. For example, you can manually grant permissions for your users on the app folder in the ProgramFiles and/or registry keys used by the program. So when starting such a program under non-admin user account, a UAC prompt will appear and the user will be required to enter an administrator password (if User Account Control is enabled on the computer). To bypass this mechanism, many users simple disable UAC or grant admin privileges to a user by adding a user account to the local group “Administrators”. Of course, both methods are not safe.

Contents:

  • Why some Windows apps not run under standard users and require administrator permissions?
  • How to run a program that requires admin privileges under standard user?
  • How to Bypass UAC with RunAsInvoker in __COMPAT_LAYER?
  • Enable RunAsInvoker Mode in the EXE File Manifest

Why some Windows apps not run under standard users and require administrator permissions?

An app may need the administrator privileges to modify some files (logs, configs, etc.) in its own folder in the C:Program Files (x86)SomeApp. By default, users don’t have edit (write and modify) permissions on this directory. In order this program to work normally, the administrator permissions are required. To solve this problem, you have to manually grant the modify and/or write permission for a user (or the built-in Users group) on the app folder at the NTFS file system level.

assigning edit permissions on folder for regular users

Note. Actually, it is not recommended to store the changing application data in its own folder under C:Program Files. It’s better to store the app data in the user profile. But it is a question of laziness and incompetence of the app developers.

How to run a program that requires admin privileges under standard user?

Earlier we described how to disable a UAC prompt for the certain app using RunAsInvoker parameter. However, this method is not flexible enough.

You can also use RunAs with the saved administrator password (in the Windows Credentials Manager) using the /SAVECRED option. It is also insecure because the user can use the saved administrator credentials password to run any program on this computer.

Let’s consider an easier way to force any program to run without administrator privileges (without entering the admin password) and with UAC enabled (Level 4, 3 or 2 of the UAC slider).

Let’s take the Registry Editor as an example — regedit.exe (it is located in the C:Windows folder). Notice the UAC shield next to the app icon. This icon means that elevation of privileges via UAC will be requested to run this program.

uac shield next to the app icon on windows10

If you run regedit.exe, you will see a User Account Control window asking for the administrator credentials (Do you want to allow this app to make changes to your device?). If you do not provide a password and do not confirm elevation, the app won’t start.

uac prompts for admin password to run program

Let’s try to bypass the UAC request for this program. Create the text file run-as-non-admin.bat containing the following code on your Desktop:

cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"

To force the regedit.exe to run without the administrator privileges and to suppress the UAC prompt, simple drag the EXE file you want to start to this BAT file on the desktop.

run a program under user with UAC prompt bypass

Then the Registry Editor should start without a UAC prompt and without entering an administrator password. If you open the Task Manager and add the Elevated column, you will see that there is the regedit.exe process without the elevated status (run with non-admin user permissions).

task manager not elevated app

Try to edit any parameter in the HKEY_LOCAL_MACHINE registry hive. As you can see, a user cannot edit the item in this registry key (the user doesn’t have write permissions to the system registry keys). But you can add or edit registry keys and parameters in your user hive — HKEY_CURRENT_USER.

regedit run as standard user without admin rights

In the same way you can run any app using the BAT file. Just specify the path to the executable file.

run-app-as-non-admin.bat
Set ApplicationPath="C:Program FilesSomeApptestapp.exe"
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %ApplicationPath%"

You can also add a context menu that allows to run all apps without elevation. To do it, create the RunAsUser.REG file, copy the following code into it, save and import it into the Windows registry by double clicking on the reg file (you will need administrator permissions to apply this change).

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*shellforcerunasinvoker]
@="Run as user without UAC privilege elevation"
[HKEY_CLASSES_ROOT*shellforcerunasinvokercommand]
@="cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "%1"""

add run without uac elevation to file explorer on win10

After that, to run any application without the administrator privileges, just select “Run as user without UAC privilege elevation” in the context menu of File Explorer.

Run program as user without UAC privilege elevation

Let me remind you once again that using the program in the RUNASINVOKER mode won’t allow you to elevate the program. The RunAsInvoker suppresses UAC prompt and tells the program that it should run with the permissions of the current user, and not ask for elevation of privileges. If a program really needs elevated privileges to edit system settings or files, it won’t work or will ask for admin permissions again.

How to Bypass UAC with RunAsInvoker in __COMPAT_LAYER?

The environment variable __COMPAT_LAYER allows you to set different compatibility levels for the applications (the Compatibility tab in the properties of an EXE file). Using this variable, you can specify the compatibility settings to be used when starting a program. For example, to start an app in Windows 8 compatibility mode and 640×480 resolution, set the following:

set __COMPAT_LAYER=Win8RTM 640x480

run an ap in windows compatibility mode

The __COMPAT_LAYER variable has some options we are interested in. There are the following parameters:

  • RunAsInvoker – run an app with the privileges of a parent process without the UAC prompt;
  • RunAsHighest – run a program with the highest-level permission available to the user (the UAC prompt will appear if a user has the administrator privileges);
  • RunAsAdmin – run an app as administrator (the UAC prompt appears each time).

It means that the RunAsInvoker parameter doesn’t provide the administrator permissions, but only suppresses the UAC prompt.

The following CMD code enables the RunAsInvoker mode for the current process and runs the specified program without elevation:

set __COMPAT_LAYER=RUNASINVOKER
start "" "C:Program FilesMyApptestapp.exe"

Enable RunAsInvoker Mode in the EXE File Manifest

As we said above, Windows 10 displays a UAC shield icon for programs that require elevation to run. Developers set this requirement when compiling the application in the program manifest .

You can edit the manifest of any exe file and disable the requirement to run the program in elevated mode.

To edit the program manifest, you can use the free Resource Hacker tool. Open the executable file of the app in Resource Hacker.

In the tree on the left, go to the Manifest section and open the program manifest. Pay attention to the following xml section:

<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>

It is thanks to the requireAdministrator option that Windows always tries to run this program as an administrator.

Change requireAdministrator to asInvoker and the save changes in exe file.

edit manifest of the exe file add asInvoker option

Note that now the UAC shield has disappeared from the program icon, and you can run it without asking for administrator password with the current user permissions.

remove uac shield from app icon via manifest

If the executable app file is signed with MS Authenticode (Code Signing certificate), then after modifying the exe file, it may stop working or issue a warning.

In this case, you can force the program to use an external manifest file. Create a plain text file appname.exe.manifest (for example, Autologon.exe.manifest) in the directory with the exe file and copy the manifest code from Resource Hacker into it. Change requireAdministrator to asInvoker. Save the manifest file.

To have Windows always try to use the external manifest file when launching exe files, enable a special registry parameter:

REG ADD "HKLMSOFTWAREMicrosoftWindowsCurrentVersionSideBySide" /v PreferExternalManifest /t REG_DWORD /d 1 /f

Restart Windows and make sure the program is using an external manifest file that says to run without administrator privileges.

Skip to content

Often, you need to run apps elevated in Windows Vista, Windows 7 or Windows 8. Programs which require admin privileges show a UAC prompt. The Registry Editor app is a good example of such an app. If the application you are using frequently requires a UAC request every time you start it, it can be a bit annoying. In this article, we will see how to create a shortcut to run apps elevated without a UAC prompt in Windows Vista, Windows 7 or Windows 8.

To bypass the UAC prompt and start an app elevated, you need to create a special task in the Windows Task Scheduler which allows executing apps with admin privileges. The Task Scheduler has a graphical MMC version (taskschd.msc) which we will use.

In the tutorial below, I will show how to make Regedit run elevated without a UAC prompt. You can repeat the steps for any app you want to launch elevated.

Create a shortcut to run apps elevated without a UAC prompt in Windows Vista, Windows 7 and Windows 8.

  1. Open Control Panel.
  2. Go to Control PanelSystem and SecurityAdministrative Tools.Windows 8 administrative tools
  3. Click the shortcut Task Scheduler:Windows 8 task scheduler
  4. On the left, click the item Task Scheduler Library:Windows 8 task scheduler library
  5. On the right, click on the link Create task:Windows 8 task scheduler create task link
  6. A new window «Create Task» will be opened. On the General tab, specify the name of the task. Pick some clear name like «App name — elevated». In my case, I will use «Regedit(elevated)».
    You can also fill the description if you want.Windows 8 task scheduler create task - general
  7. Now tick the checkbox named «Run with highest privileges»:Windows 8 task scheduler create task - general tick privileges
  8. Now, switch to the Actions tab. There, click the «New…» button:Windows 8 task scheduler create task - actions
  9. The «New Action» window will be opened. There, you can specify the path to the executable file of the app you are trying to run elevated without a UAC prompt. In my case, I will enter
    c:windowsregedit.exe

    See the following screenshot:Windows 8 task scheduler create task - new action

    Note: by default, apps started from tasks like we just created, will start without getting focus. Its window might appear in the background.
    If you are not happy with this issue, then add the Action for the task as follows:
    — In «Program/Script», enter the following:

    C:windowssystem32cmd.exe

    In «Add agruments», type the following:

    /c start "" program.exe program arguments if required

    In my example with Regedit it will look as follows:Windows 8 task scheduler create task - new action cmd

  10. Click OK in the New Action dialog to close it.
  11. Switch to the Conditions tab:Untick these options
    — Stop if the computer switches to battery power
    — Start the task only if the computer is on AC power
    See the following screenshot:Windows 8 task scheduler create task - conditions tickedWindows 8 task scheduler create task - conditions unticked
  12. Now, click OK to close the Create Task window. It is a good idea to test your task right now. Right click it and select Run from the context menu. It should open the app you specified:Windows 8 task scheduler run taskWindows 8 task scheduler task started
  13. Now, create a new shortcut to launch the app from your Desktop.
    Right click the empty space on your Desktop and select New -> shortcut:Windows 8 new shortcut
  14. In the «Type the location of the item» box, enter the following:
    schtasks /run /tn "your task name"

    In my case, it should be the following command:

    schtasks /run /tn "Regedit(elevated)"

    Windows 8 shortcut target

  15. Name your shortcut as you want:Windows 8 shortcut name regedit elevated
  16. Finally, set the appropriate icon for the shortcut you have created and you are done:Windows 8 shortcut icon regedit elevated

That’s it. As you can see, creating elevated shortcuts takes too many actions and a notable amount of time.
To save your time, you can use Winaero Tweaker. The feature called «Elevated Shortcut» does everything mentioned above and helps you to create elevated shortcuts quickly.

  1. Download and unpack Winaero Tweaker app.
  2. Go to Tools Elevated Shortcut:Winaero Tweaker ES1
  3. Create a shortcut using its friendly user interface and you are done!

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won’t take a lot from you, but it will help us grow. Thanks for your support!

Hello. Add your message here.

Многие программы при запуске требуют повышения прав (значок щита у иконки), однако на самом деле для их нормальной работы прав администратора не требуется (например, вы вручную предоставили необходимые права пользователям на каталог программы в 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:windowssystem32). При запуске 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 файл и конкретное приложение, достаточно указать путь к исполняемому файлу.

run-app-as-non-admin.bat

Set ApplicationPath="C:Program FilesMyApptestapp.exe"
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %ApplicationPath%"

Также можно добавить контекстное меню, которое добавляет у всех приложений возможность запуска без повышения прав. Для этого создайте следующий reg файл и импортируйте его в реестр.

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*shellforcerunasinvoker]
@="Run as user without UAC elevation"
[HKEY_CLASSES_ROOT*shellforcerunasinvokercommand]
@="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 640x480

Из интересных нам опций переменной __COMPAT_LAYER выделим следующие параметры:

  • RunAsInvoker
    — запуск приложения с привилегиями родительского процесса без запроса UAC.
  • RunAsHighest
    — запуск приложения с максимальными правами, доступными пользователю (запрос UAC появляется если у пользователя есть права администратора).
  • RunAsAdmin
    — запуск приложение с правами администратора (запрос AUC появляется всегда).

Т.е. параметр RunAsInvoker не предоставляет права администратора, а только блокирует появления окна UAC.

В любом предприятии, в котором компьютеры/программное обеспечение обслуживают адекватные люди, обычные пользователи компьютеров не имеют никаких админских прав за ними, что значительно снижает риск удаления важных файлов системы, установку непонятного программного обеспечения и прочих чудес. Однако, некоторые программы упорно не желают работать без прав администратора — и что же делать, если желания давать права администратора компьютера пользователю нет, а необходимость запустить приложение — есть?

В статье пойдет речь о том, как предоставить обычному пользователю возможность запустить приложение, и не выдавать ему права администратора на компьютере.
Речь пойдет о двух способах — более-менее безопасном (Выдача прав на папку с программой), и менее безопасном (способ с использованием программы RunAs).

Выдача прав на папку с программой

Часто, права администратора требуются программе для проведения каких-либо операций с файлами в своей папке — например некой Programm’e нужно записывать данные в свой файл конфигурации в папку, куда она установлена (допустим этот каталог C:Program Files (x86)Programma
). Можно попробовать выдать нужным пользователям полные права на эту папку. Делается это следующим образом:

  1. Правой кнопкой нажимаете на папке, открываете Свойства
  2. В Свойствах нужно открыть вкладку Безопасность
    .
  3. В зависимости от настроек компьютера там может отображаться либо «Добавить
    «, либо «Изменить
    «. В первом случае нужно нажать кнопку «Добавить
    «, во втором — «Изменить
    «, после чего скорее всего потребуется ввести данные учетной записи администратора. После этого появится окно с кнопкой «Добавить
    «, которую и нужно будет нажать.
  4. После нажатия кнопки «Добавить
    » добавляем всех нужных пользователей. Для проверки правильность ввода имени пользователя можно воспользоваться кнопкой «Проверить имена
    «.
  5. Затем выдаем полные права добавленному пользователю — для этого нужно поставить галочку в поле «Разрешения для….
    «, пункт «Полные права
    «.

Запуск программы под учетной записью админстратора с учетной записи обычного пользователя

Для этой цели сгодится программа RunAs, которая идет в составе Windows. Для удобства её использования проще всего будет создать cmd файл, в который следует поместить следующее:

C:WINDOWSsystem32runas.exe /user: /SAVECRED 

Вместо Домена пользователя и Пользователя вводим данные учетной записи пользователя, который обладает правами администратора в домене, или на компьютере (в таком случае, вместо Домена пользователя следует писать имя компьютера). Вместо Путь к программе соответственно пишем путь к нужному exe файлу.

Сохраняем этот файл, и запускаем. Если все прошло верно, то при первом запуске bat файла, будет запрошен пароль для указанного пользователя, однако уже при повторном запуске никакого запроса пароля не потребуется — для этого используется параметр /SAVECRED
.

Оценить статью

Статья представляет собой простой способ принудительного запуска программы без прав администратора и подавлением запроса контроля учетных записей пользователей (UAC). 

Многие программы при запуске требуют повышения прав (значок щита у иконки), однако на самом деле для их нормальной работы права администратора не требуется.

Соответственно, если на компьютере включен контроль учетных записей, то при запуске такой программы из-под непривилегированного пользователя появится запрос UAC и Windows потребует от пользователя ввести пароль администратора.

В данной статье, в качестве примера, продемонстрирован запуск установочного файла программы WinRAR однако, приведенный ниже способ подходит для запуска и установки большинства программ на ОС Windows 7, 8, 8.1, 10, 11. 


ВАЖНО!
Нижеописанный способ не позволит вам получить повышенные права для программы. Используемый параметр RUNASINVOKER подавляет окно UAC и сообщает программе, что она должна запуститься с правами текущего пользователя и не запрашивать повышение привилегий. Если программе действительно нужны повышенные права для редактирования системных параметров или файлов, она не будет работать или повторно запросит права администратора.

Решение:

1. При попытке запуска программы требующей повышения прав (прим. в данном примере это WinRAR) перед вами появится окно Контроль учетных записей пользователя с запросом имени и пароля пользователя имеющего права администратора. Если не указать пароль и не подтвердить повышение привилегии, приложение не запустится (Рис.1).

Рис.1

.

2. Вызовите меню (прим. для вызова меню нажмите правой кнопкой мыши), выберите Создать, затем выберите Текстовый документ (прим. после создания текстового документа, присвойте ему имя. В данном примере имя RUN, но вы можете выбрать любое другое) (Рис.2).

Рис.2

.

3. Откройте созданный текстовый документ и введите:

cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"

(прим. можете скопировать отсюда и вставить в текстовый документ) (Рис.3).

Рис.3

.

4. Выберите в окне Файл, затем нажмите Сохранить как… (Рис.4).

Рис.4

.

5. Сохраните текстовый документ с расширением .bat (прим. в данном примере это RUN.bat) (Рис.5).

Рис.5

.

6. Для принудительного запуска приложения без прав администратора и подавлением запроса UAC, перетащите файл, который нужно запустить (прим. в данном примере это WinRAR) на созданный .bat файл (прим. в данном примере это RUN.bat) на рабочем столе (Рис.6).

Рис.6

.

7. Файл запустится без появления запроса UAC и без ввода пароля администратора (Рис.7).

Рис.7

.

Запуск программы без прав администратора завершен!

.

Понравилась статья? Поделить с друзьями:
  • Windows rt surface 64gb планшет характеристики
  • Windows rt surface 32 gb обновить до windows 10
  • Windows route add узнать номер интерфейса
  • Windows root system32 ntoskrnl exe что делать
  • Windows root system32 ntoskrnl exe скачать