AutoHotkey

  在AutoHotkey文件夹下有个Lib,可放入一些Fuction脚本,在网上曾淘到一个以管理员身份运行的脚本,调用方式是RunAsAdmin(),非常方便。

  整个文件备份在百度网盘中。

  自己编写了一个开机运行的脚本,放在HKCU\Software\Microsoft\Windows\CurrentVersion\Run中,数值为d:\software\AutoHotkey_L\AutoHotkey.exe d:\software\AutoHotkey_L\AutoHotkey.ahk。

 


~LButton & Alt::
WinGet,Path,ProcessPath,A
Run, % "explorer.exe /select," Path
return

 

menu,tray,icon,%systemroot%/system32/shell32.dll,131
SetTitleMatchMode,RegEx
RunAsAdmin()

::ggyx::gosealine@gmail.com
::wyyx::suyiben@126.com
::tclj::%Commander_path%
::blyc::SetLocal EnableDelayedExpansion
::xzhf::感谢楼的主分享,很难得
  
#P::
Run, PowerShell.exe, %USERPROFILE%\desktop
WinWait 管理员: Windows PowerShell
WinActivate
return

!^p::
runwait, control inetcpl.cpl`,`,4
return

~LButton & Alt::
WinGet,Path,ProcessPath,A
Run, % "explorer.exe /select," Path
return

#F12::
 Shutdown, 1    #关机
return
#F11::    
 Shutdown, 0    #注销
return
#F10::
 Shutdown, 2    #重启
return
#F9::
 DllCall("PowrProf\SetSuspendState", "int", 1, "int", 1, "int", 1)    ;休眠
return

#T::
For objOS In ComObjGet("winmgmts:\\").InstancesOf("Win32_OperatingSystem") {
    temp := objOS.LastBootUpTime
    StringLeft, dtmLastBootUpTime, temp, 14
    dtmSystemUpTime := %A_Now%
    EnvSub, dtmSystemUpTime, %dtmLastBootUpTime%, Seconds
    Sec := dtmSystemUpTime
    H := Sec//3600
    H1 := Mod(Sec,3600)
    M := H1//60 
    S := Mod(H1,60)
    MsgBox %H%小时%M%分钟%S%秒
}
return

#+l::
IfWinExist ahk_class IEFrame
{   
 IfWinNotActive ahk_class IEFrame   
  WinActivate
 sendinput ^thttp://221.13.223.146/{enter}  

}
else
{
 run,iexplore.exe http://221.13.223.146/,,max
 WinWait ahk_class IEFrame
 WinActivate
}
 Sleep,10000
 click 921,205
 SendInput 18660820434{tab}200800
 click 838,360
return


#+z::
Process, exist, ZTESupplicant.exe
if %errorlevel%
{
    WinShow, ahk_pid %ErrorLevel%
    WinActivate, ahk_pid %ErrorLevel%
    Sleep, 500
    WinHide, ahk_pid %ErrorLevel%
}
else
{
 Run, c:\Program Files (x86)\zte\ZTE Supplicant\ZTESupplicant.exe, , , ZTEPID
 WinWait ZXISAM PPPOE Client
 WinActivate
 Sendinput 201104415{tab}886165
 Send {tab 2}{down 4}{tab}{Space}
 Sleep, 2000
 Loop, 3
{    
if WinExist("ZXISAM PPPOE Client")
;~ ifWinExist ahk_pid %ZTEPID%  
{
    Send {Space}
    Sleep, 2000
}
}
}
Run, taskkill.exe /f /im zte*
 return
 
#+d::
strComputer := "." 
objWMIService := ComObjGet("winmgmts:{impersonationLevel=impersonate}!\\" . strComputer . "\root\cimv2")

colProcesses := objWMIService.ExecQuery("select * from win32_process Where Name = 'ZTESupplicant.exe'" )._NewEnum
while colProcesses[objProcess]
    objProcess.Terminate()

colAdapters := objWMIService.ExecQuery("select * from WIN32_NetworkAdapter where Index=10")._NewEnum
While colAdapters[objAdapter]
    objAdapter.Disable
    objAdapter.Enable
    
;~ Run, %ComSpec% /c net stop SharedAccess & sc config SharedAccess start=demand
return

#+t::
IfWinExist ahk_class TTOTAL_CMD
{
 IfWinNotActive ahk_class TTOTAL_CMD
 WinActivate
 Else
 WinMinimize
}
else
{
 Run,d:\software\totalcmd\TOTALCMD.EXE
 WinWait ahk_class TTOTAL_CMD
 WinActivate
}
return

#f::
IfWinExist ahk_class MozillaWindowClass
{
 IfWinNotActive ahk_class MozillaWindowClass
 WinActivate
 Else
 WinMinimize
}
else
{
 Run,d:\software\firefox\Run_FF.exe
 WinWait ahk_class MozillaWindowClass
 WinActivate
}
return

#o::
IfWinExist ahk_class OperaWindowClass
{
 IfWinNotActive ahk_class OperaWindowClass
 WinActivate
 Else
 WinMinimize
}
return

#c::
Run, d:\software\SciTE_TCC_win\SS.exe
return

#v::
IfWinExist ahk_class ahk_class Afx:00400000:b:*
{
 IfWinNotActive ahk_class ahk_class Afx:00400000:b:*
  WinActivate
 else
  WinMinimize
}
else
{
 Run c:\Program Files (x86)\Vbsedit\vbsedit.exe
 WinWait ahk_class #32770
 WinActivate
 SendInput {Tab 2}{Enter}Option explicit{enter}
}
return


#IfWinActive ahk_class TTOTAL_CMD
~LButton & RButton::
Send ^w2
return
~RButton & LButton::
Send ^t
Return


$MButton::
 WinGetClass,sClass,A
 if (sClass="TTOTAL_CMD")
 Send, {BS}
 else sendplay {MButton}
return

#IfWinActive ahk_class ConsoleWindowClass
^v::
;~ CoordMode,Mouse,Relative
;~ click 300,34,right
;~ Send p
SendInput, %Clipboard%
return

 

posted @ 2013-10-10 12:44  cnsealine  阅读(994)  评论(0编辑  收藏  举报