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:
-
/c
string
Execute the command specified by
string
and terminate the console.-
/k
string
Execute the command specified by
string
and 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 /k
string
, wherestring
is 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. ...
Get Windows 2000 Quick Fixes now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.