1

I have a file that, whenever I run it, asks for administrator permissions. How can I disable this so I can use it on other computers?

fixer1234
  • 27,486
TA10S
  • 41
  • 1
  • 1
  • 2

1 Answers1

3

Try to start the program from a batch file that first sets an environment variable

set __COMPAT_LAYER=RunAsInvoker

and check if it runs as the original user then (without needing elevation). Note that even when running without needing elevation, that does not mean it will work that way.

If yes, there are three possible reasons this program requires elevation

  • Magic filename hardcoded in Windows (like setup.exe, install.exe)
  • File has a manifest lying nearby (somefile.exe has somefile.exe.manifest) that requires elevated privileges
  • File has an embedded manifest that requies elevated privileges

First one is easy to solve (rename it), second as well (delete the manifest), for the third you'd have to extract the manifest with a resource extraction tool (which will invalidate the digital signature if any).

If no, the program checks for privileges and launches the dialog manually (by code). In that case if you don't have the source code to recompile the application, you are out of luck.

mihi
  • 3,437
  • Related Question with similar solutions - readers may find useful. [Force a program to run without* administrator privileges or UAC?](https://superuser.com/questions/171917/force-a-program-to-run-without-administrator-privileges-or-uac)* – Mister_Tom Aug 31 '17 at 21:38
  • 1
    Would like to point out there is a 4th option: Windows compatiblity database. This is why for example MassEffect.exe (the first game's exe) must run as administrator without being patched - if name is MassEffect.exe and name of a certain property in manifest is "Mass Effect", Windows forces it to run as admin. – Mgamerz Nov 16 '19 at 20:39