I have already used the Run command in two of my previous posts: Launching Google and Launching Calculator using AutoHotKeys.
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 on Start –> Run
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.
For e.g. C:\My Documents\Meghna.doc
Note: The Windows Operating System treats Notepad as a Program and Microsoft Word as a document. Thus, typing Microsft Word in the Run command box will give you an error and instead you need to specify the complete path for it.
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.
#m::
Run Notepad.exe
Run www.yahoo.com
Run Calc.exe
Run www.google.com
return
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:
#m::
Run Notepad.exe, , max
Run www.yahoo.com
Run Calc.exe
Run www.google.com, , min
return
Now when you use this script, the Notepad will open maximized on your screen, while the google browser window will be minimized.
Meghna
Related posts:
Auto-Hotkeys for AutoHotkey
People are frequently executing simple tasks without AutoHotkey because it is not practical to remember...
Launching AutoHotkey automatically
AutoHotKey is a really useful software, but I am sure at some point you have...
Everything about the installation of AutoHotkey
(Updated July 31, 2008) Installing AutoHotkey on Windows Operating System is very easy. —Install the...
AutoHotKey script; Launching Calculator
In my opinion, one of the most useful applications included with Windows is their calculator....
Pingback: Websites tagged "autohotkey" on Postsaver