avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday July 15, 2024, 2:51 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: ReRun - Run a program repeatedly on hotkey  (Read 4007 times)


  • Participant
  • Joined in 2021
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
  • WarningUser is banned
ReRun - Run a program repeatedly on hotkey
« on: July 23, 2021, 12:13 AM »
When a certain hotkey is pressed, ReRun asks you for a program and runs it. From then on, everytime this hotkey is pressed, the program is run again.

This is useful if you working to improve a script/ ahk file / batch file and need to test it repeatedly, or are needing to manually compile/deploy/run commands repeatedly. Using rerun is faster than finding the active window and clicking on a program to launch it.

Code: C++ [Select]
  1. ; Change line 6 to a new hotkey: see
  3. #NoEnv
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5. §::
  6. if program =
  7.         FileSelectFile, program, 3, , Open a file, Programs (*.bat; *.com; *.exe)
  8. if program <>  
  9. {
  10.         SplitPath, program ,, OutDir
  11.         SetWorkingDir %OutDir%
  12.         RunWait, %program%
  13. }
  14. return

Note: the default hotkey is §, which is handy if you have a mac uk keyboard, but annoying if you don't. So change the start of line 5.

Mod Note: though the poster turned out to be a spammer, the script might be of use to someone.
« Last Edit: July 24, 2021, 09:08 AM by wraith808 »