Windows Administration at the Command Line




7

be scratching your head after you read the description. Older commands don't provide a description
at all; you just have to know what task they perform, which is why many people don't use them.

A description of the individual parameters (or arguments and inputs) comes next. These entries
tell you how to use the individual command line switches. You'll also discover about other kinds
of information you must provide. For example, the


Dir

(directory) command information shown
in Figure 1.4 tells you that you can provide a drive letter, followed by a colon, followed by a direc-
tory path, and ending with a filename specification. None of these entries is a command line switch,
but they're all important parameters.


Figure 1.4

Sometimes you
provide text input
as well as command
line switches.


The final section is a list of examples. Only a few commands provide this kind of information, but it's
always helpful when they do. The examples come in many forms. The T

askList

command provides a
list of filters first, so you can see how to get the output you want. It provides actual usage examples next
so you can see what to type at the command line. The point is that most people could use a command at
the command prompt if they simply knew the simple


/?

command line switch. Go ahead and try it out
now with the

TaskList

and

Dir

commands. You'll want to keep the

/?

command line switch in mind as
you read about other commands in this book. Try it out with every one of them and you'll find that most
commands provide some information, usually enough to jog your memory when you need to use it .


Storing Commands in Batch Files

I've worked at the command line for years, so you might assume that I have all of these commands mem-
orized by now. However, like many people, I find that memorizing all of those commands, their param-
eters, and their command line switches is just too much work. However, discovering the required
parameters one time isn't too much work. That's where batch files come to my aid. I use batch files to
remember specific command sequences for me.

When you need to store one or more commands so you don't have to remember them every time you
want to use them, a batch file can do the job. In fact, you can create batch files that have a limited
amount of intelligence so they don't perform the same task in the same way every time. Batch files are
the first method that many people use to automate the command line. I have batch files that I wrote over
18 years ago when I started with computers and I'm still using them today. In short, a good batch file can
last a very long time. The thing to remember about batch files is that they're very easy to write, only have
a little intelligence (so there isn't any heavy coding), and don't require anything special to execute.
You'll discover how to work with batch files in Chapter 7.