Providing admin rights to application launching from start /menu
Answers (4)
Comments:
-
hi thanks for comment,but it should run for any user. i am trying to deploy it silently on user's machines. so will it work with above key? - swap20june 10 years ago
-
Thanks for tips. it worked.... - swap20june 10 years ago
You'll likely need to set the "Run as administrator" flag in the Compatibility settings of the executable. Just right click the shortcut, select Properties, then switch to the Compatibility tab and check the box "Run as administrator" near the bottom. You can also click the button to change the settings for all users.
You can also do this in the registry as part of the installation script. The key you would put it in for all users is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
or for just the current user
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
Create a string value, the name being the full path to the executable, then the data is just a space separated list of the flags. For Run as administrator, just add the flag:
RUNASADMIN
Here's a good link to some more info: http://www.intrntpirate.com/?tag=appcompatflags
Comments:
-
Agreed. We run into this a lot with LOB apps, where the software vendor's support staff says "what do you mean your users aren't local admins? just make them a local admin." Then after we push back, or do some of our own digging, we figure out we just need to open up permissions on a certain file, folder or registry key. - BHC-Austin 10 years ago
-
hi sorry for opening this question again,but this key doesnot solve the problem. when tested as a local user/without admin rights the application again asks for admin user id and password. i observed when launching from start /menu programe it has run as admin option also. need immediate help. its urgent. thanks - swap20june 10 years ago
-
does shimming will work? - swap20june 10 years ago
-
quick and dirty method:
use pstools psexec to run it as admin, just have a shortcut that points to an exe you compiled calling psexec with the proper parameters to call the exe.
create a bat file like this:
psexec -i -accepteula -u .\administrator -p password -d setup.exe
then use something like "bat to exe" to compile so the password does not show.
place all 3 exe's in same place and create shortcut on start menu to the compiled exe.
you can also run a vb script to do this via a shortcut:
https://www.google.com/search?q=vb+script+to+run+a+program+as+admin&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb#channel=fflb&q=vbscript+to+run+a+program+as+admin&rls=org.mozilla:en-US:official&spell=1 - SMal.tmcc 10 years ago
thanks all - swap20june 10 years ago