Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop program from running as admin

Tags:

uac

windows-10

I have a program that runs with elevated privileges when I double click on the icon(Task Manger shows Elevated = Yes). I do not want it to run with elevated privileges but I have not been able to figure out how to turn it off.

I checked the following places:

1.)Right Click on the shortcut -> Advanced -> Run as admin is unchecked

2.)Right Click on the shortcut -> Compatibility -> Run as admin is unchecked

3.)Right Click on the exe -> Compatibility -> Run as admin is unchecked

I've tried the following commands:

1.)runas /trustlevel:0x20000 "newapp.exe"

2.)runas /user:domain\username "newapp.exe"

No matter what I do or check the app still runs with elevated privileges. Any ideas on how to resolve this issue is greatly appreciated.

like image 544
Weston Goodwin Avatar asked Jan 31 '26 07:01

Weston Goodwin


1 Answers

There are at least 4 reasons why Windows might decide to UAC elevate a new process.

  • requestedExecutionLevel in the manifest is set to requireAdministrator or highestAvailable.
  • Installer detection.
  • The compatibility tab for the shortcut or .exe has set certain properties (run as Windows XP etc.)
  • ShellExecute was invoked with the RunAs verb.

The application manifest is embedded in the .exe or in a file next to it named "applicationname.exe.manifest". You can explore the embedded manifest with a tool like Manifest View or Resource Hacker.

If you did not write the application yourself, do you actually know if it will even work if not elevated? You can try to force it in cmd.exe:

set __COMPAT_LAYER=RunAsInvoker
c:\path\theapp.exe
like image 79
Anders Avatar answered Feb 03 '26 09:02

Anders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!