AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Restore ctrl+shift+Enter to run selected as admin

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
dwjp90



Joined: 20 Jul 2009
Posts: 40

PostPosted: Sat Nov 21, 2009 1:34 am    Post subject: Restore ctrl+shift+Enter to run selected as admin Reply with quote

this return the ability to hit ctrl+shift+enter and it will run the selected file as an admin (exes only)

works in start menu, explorer and desktop

requirements

Quote:
all three require this

http://www.ntwind.com/software/utilities/hstart.html

start menu "run as" requires this to work

http://www.gnostice.com/nl_article.asp?id=168&t=Copy_File_Path_and_Name_using_Windows_Explorer_Context_Menu_Extensions



heres the code

Code:
$^+Enter::
{
   ifwinactive, ahk_class DV2ControlHost
      {
         sleep 400
         Clipboard:=""
         sleep 400
         send {appskey}{down}{down}{down}{enter}
         clipwait
         run "C:\Program Files\hstart\hstart.exe" /runas /shell "%clipboard%" ;runs selected file as admin
         return
      }
   else ifwinactive, ahk_class Progman
      {
         Clipboard:=""
         Send ^c
         ClipWait,1
         Clipboard:=Clipboard
         run "C:\Program Files\hstart\hstart.exe" /runas /shell "%Clipboard%" ;runs the selected file as admin
         return
      }
   else ifwinactive, ahk_class CabinetWClass
      {
         Clipboard:=""
         Send ^c
         ClipWait,1
         Clipboard:=Clipboard
         run "C:\Program Files\hstart\hstart.exe" /runas /shell "%Clipboard%"
         return
      }
   else
      {
         ;msgbox, Not active ;enable this to test
         send ^+{enter}
      }
}
return
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group