The Run command is used to launch a program, document, URL, and even shortcuts.
Most of you must already be familiar with the Windows version of the Run Command. If you are not, try this:
Click the Start button on Windows then type “Run” then hit “Enter“.
A Run command window will now open; just type in the name of the program or complete URL of the Web site you want to open. For documents, however, you need to specify the complete path like “C:\My Documents\Meghna.doc”
AutoHotKeys allows you to have lot more fun with the Run command. You can launch multiple programs or Web sites at once, choose how they open, specify working directories, pass parameters etc.
Let me just start off with showing you one of its simplest uses: Launching multiple programs at once.
The above script will open the notepad, calculator and the home pages of both yahoo and google as soon as you press the Windows+m keys on your keyboard. Since AutoHotKeys executes scripts top-down, the programs will open in that order, so you can of course write them in order of your own preference.
The above script is an example of a multi-command line script and that is why we have put the commands beneath the hotkey definition. This improves readability and makes it easier to modify the scripts later, especially for larger scripts.
The Return command will exit the script (you will understand its real importance later). In single-line scripts, using the return command was unnecessary as exit was implied.
Let’s see another variation of the above script:
Now when you use this script, the Notepad will open maximized on your screen, while the google browser window will be minimized.