Epulone Posted December 26, 2018 Share Posted December 26, 2018 Is there a way to run a script [complied (.exe)] with the admin right? If I use: #RequireAdmin= it will ask for the admin password RunAs and RunAsWait are designed to work only if I have an external program to run (not for elevate it-self). Thanks Link to comment Share on other sites More sharing options...
kosamja Posted December 26, 2018 Share Posted December 26, 2018 If RegRead('HKEY_CLASSES_ROOT\exefile\shell\runas\command', '') <> '"%1" %*' Then RegWrite('HKEY_CURRENT_USER\SOFTWARE\Classes\exefile\shell\runas', 'HasLUAShield', 'REG_SZ', '') RegWrite('HKEY_CURRENT_USER\SOFTWARE\Classes\exefile\shell\runas\command', '', 'REG_SZ', '"%1" %*') RegWrite('HKEY_CURRENT_USER\SOFTWARE\Classes\exefile\shell\runas\command', 'IsolatedCommand', 'REG_SZ', '"%1" %*') EndIf ShellExecute(@ScriptFullPath, '', StringRegExpReplace(@WorkingDir, '\\+$', ''), 'runas') Link to comment Share on other sites More sharing options...
Epulone Posted December 26, 2018 Author Share Posted December 26, 2018 Thank you kosamja using your code I have the error below .....however the script does't run as an administrator Link to comment Share on other sites More sharing options...
rudi Posted December 30, 2018 Share Posted December 30, 2018 Hi. you are again asking howto bypass Windows' buildin security mechanisms. #RequireAdmin= it will ask for the admin password Exactly. Thats WAD (working as designed), and it's good, that it's WAD! Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Developers Jos Posted December 31, 2018 Developers Share Posted December 31, 2018 On 12/26/2018 at 6:44 PM, Epulone said: If I use: #RequireAdmin= it will ask for the admin password RunAs and RunAsWait are designed to work only if I have an external program to run (not for elevate it-self). Don't you think there is a reason for this that they have build it this way? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 31, 2018 Moderators Share Posted December 31, 2018 @Epulone We just had this exact conversation at great length via PM; I don't get what you are unable to understand. You are not going to get help bypassing inherent Windows security features. Do not ask this again if you wish to stay on this forum. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts