kyle_engineer

AHK - Kill and Launch

Aug 30th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ;Hotkey 1
  3. ;check if program is running
  4. ; - if it is, kill it and start a new instance
  5. ; - if not, start a new instance
  6. ^!1::
  7. IfWinExist,  ("ahk_exe ImgBurn.exe")
  8. {
  9.     Process, Close, ImgBurn.exe
  10.     WinWaitNotActive, ("ahk_exe ImgBurn.exe")
  11.     Run C:\Program Files\ImgBurn\ImgBurn.exe
  12. } else {
  13.     Run C:\Program Files\ImgBurn\ImgBurn.exe
  14.     return
  15. }
  16.  
  17. ;Hotkey2
  18. ;duplicate process of HK1, but with different program
  19.  
  20.  
  21. ;create password activated functions
  22.  
  23.  
  24.  
  25. ;testing area
  26.  
  27. ^!0:: Process, Close, notepad.exe
Advertisement
Add Comment
Please, Sign In to add comment