Hack 83 Launch Applications with Command-Line Shortcuts
Launch applications quickly and customize what they do when they run, by using command-line shortcuts, parameters, and switches .
Windows is a graphical operating system, but a lot of times all these pretty icons, menus , and clicking get in the way of getting work done. That's particularly true when you want to launch applications.
I started computing in the days of DOS, when real men and women didn't use mice and icons. (Sometimes because it wasn't an option.) So, I look for any chance I can get to use the command line, particularly when doing so saves me time and lets me take more control of my computer.
That's why I frequently launch applications using command-line shortcuts, along with parameters and switches. Parameters and switches let you customize the way programs launch. They're usually specific to each individual program, though some work on many or all programs.
An even bigger time-saver is to use the command line along with keyboard shortcuts. That way, you can press a key combinationsuch as Ctrl-Alt-W, for exampleand launch Microsoft Word with a new document open , based on a specific template.
9.5.1 Create Keyboard Shortcuts for Running Applications
You'll first, create a desktop shortcut to the application, and then you'll customize the shortcut so that it launches when you use a specific key combination. Right-click on the Desktop and choose New Shortcut. Enter or browse to the filename of the application for which you want to create a shortcut, including its path and surrounding it by quotation marks, such as " C:\Program Files\Microsoft Office\Office10\WINWORD.EXE " . Click Next; then, in the "Select a name for the shortcut box," type the name of your new shortcut (such as Basic Word ), and click Finish. Right-click on the shortcut you just created and choose Properties. In the Shortcut Tab, shown in Figure 9-5, put your cursor in the "Shortcut key" box and press the key combination you want to use to start the program. It has to be a combination of Ctrl-Alt, Shift-Alt, or Shift-Ctrl, plus a letter key, such as Ctrl-Alt-A, Shift-Alt-A, or Shift-Ctrl-A. In our instance, we're using Ctrl-Shift-W. Click OK. The program will now launch whenever you press the shortcut key combination.
Figure 9-5. The Shortcut Properties dialog box
There are a variety of entries on the Shortcut tab that let you customize how the program launches when you use the shortcut. The Run drop-down list lets you start the program minimized, maximized, or in a normal window. The "Start in" box lets you determine the start location for the application. You can even customize the ScreenTip that appears when you hover the mouse over the shortcut. In the Comment box, type the text you want to appear as a ScreenTip. Figure 9-6 shows how such a customized ScreenTip looks like when a mouse hovers over it.
Figure 9-6. A customized ScreenTip
9.5.2 Customizing Shortcuts with Switches and Parameters
Launching applications with a keyboard shortcut is a time-saver, but there's still a lot you can do to customize those shortcuts. For example, you can set up a number of separate keyboard shortcuts for Wordfor example, to launch Word with new documents based on a different templates, or to open Word to specific already-created documents.
For example, let's say you want to launch Word and have it automatically open a specific document, one called chapter 9.doc in the C:\Hacks directory. Type this (all on one line) in the Target box displayed in Figure 9-5:
"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" "C:\Hacks\chapter 9.doc"
Doing this gives you much more control that double-clicking on the document or creating a shortcut to the document, because, in addition to launching individual files, you can use a variety of switches to customize how you launch those files. For example, let's say you want to launch Word without the splash screen. Use the /q switch, like this:
"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" /q
You can then combine switches with opening individual files, like this:
"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" /q "C:\Hacks\chapter 9.doc"
This command opens the file and bypasses the splash screen. Use keyboard shortcuts along with these switches and syntax to create as many customized versions of Office applications as you like. Tables Table 9-1, Table 9-2, and Table 9-3 list switches for Microsoft applications Word, Excel, and PowerPoint, respectively.
Table 9-1. Switches for starting Word
Table 9-2. Switches for starting Excel
Table 9-3. Switches for starting PowerPoint
9.5.3 See Also