Load a special driver or program for a specific console only
The previous section explained how to configure all command consoles
to execute a command or program at startup. What if you want to
execute a driver or program only for a specific
console command or application? The
easiest method is to create a shortcut to
cmd.exe
with the
appropriate switch and command string needed to execute the program.
Create a shortcut to cmd.exe with switches
cmd.exe is the command interpreter responsible
for what you see when you open a command console, just like
command.com
on DOS and Windows systems. cmd supports several
parameters and switches that control the way it functions and enable
you to start a specific application. Two of
cmd’s switches that let you start an
application are:
-
/cstring Execute the command specified by
stringand terminate the console.-
/kstring Execute the command specified by
stringand remain.
Both switches give you a means of executing either an internal or
external command. Follow these steps to create a shortcut to
cmd that executes a program and remains (use
/c if you want the console to terminate after
executing the application):
Right-click the desktop or folder location where you want the shortcut created and choose New → Shortcut.
Type
cmd /kstring, wherestringis the command to execute. Include in the string any optional parameters or switches for the application.Specify a name for the shortcut and click Finish.
Double-click the shortcut to test it. ...
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