Execute a program using command-line switches
Command-line
switches modify the function of a command. For example, the switch
/ogn when added to a
dir
command
sorts the directory
listing with directories first followed by files, all in alphanumeric
order. You can open a console prompt and type
dir
/ogn to see how it
works. Another example is
Symantec’s
pcAnywhere, which
supports several switches that control the way pcAnywhere starts. The
/r switch, for example, hides the
startup splash screen. Microsoft Word
supports several switches including /m, which
prevents any
autoexec macros from executing. Many
other applications, including most Windows 2000 console commands,
also support command-line switches. You can incorporate these
switches in a few different ways depending on what you’re
trying to accomplish.
Tip
With most console commands you can execute the command followed by
the /? switch to view a list of available switches
and other command parameters, as well as the command syntax. For some
Windows applications, executing the program with the
/? switch opens the program’s Help file
focused on the page that references the program’s startup
switches.
Modify the shortcut’s properties
Most likely you have a shortcut on the desktop, in a folder, or in the Start menu that points to an application with which you’d like to use command-line switches to modify the program’s startup. You can add command switches simply by modifying the shortcut’s target:
Right-click the shortcut and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access