AutoHotkey Community

It is currently May 27th, 2012, 12:47 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: April 4th, 2010, 6:27 pm 
I really think AutoHotKey should have a command to request UAC admin privleges.

This will help a lot when trying to automate admin only programs and actions.

Also maybe the installer should add Run as Administrator to the context menu, same as some guides on the web showed how to do.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2010, 11:40 pm 
Offline

Joined: January 13th, 2009, 10:02 pm
Posts: 31
Quote:
I really think AutoHotKey should have a command to request UAC admin privleges.

The alternative compilerhas an option to request administrative rights to the user.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2010, 11:50 pm 
Yes, but thats only for compiled scripts.
non compiled (.ahk) ones have no option for doing so without a registry "hack".


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 6th, 2010, 2:14 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Use ShellExecute as demonstrated here. Afaik, there is no way to elevate the current process (as far as UAC is concerned); you must launch a new process. This isn't specific to AutoHotkey. I suppose allowing it would open up an avenue of attack, i.e. as the process being elevated may have been compromised.


It looks like built-in support would require that the following be done:
    1) Add "runas" to the list of allowed verbs in the IS_VERB() macro. (Very simple.)
    2a) Improve how Run parses its arguments to allow parameters with verbs. Currently it seems only Run verb target is supported; we would need Run verb target params, i.e. Run RunAs "%A_AhkPath%" "%A_ScriptFullPath%". (Not as simple, but at the same time support could be added for Run target params where target is not an exe, bat, com, cmd or hta file.)
    2b) As an alternative to the point above, add a RunAs subkey to the AutoHotkeyScript registry key, identical to the Open subkey. This would allow Run RunAs "%A_ScriptFullPath%" to be used, omitting "%A_AhkPath%" - but it wouldn't be portable.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group