The following table shows the most important DOS commands. Names in capital letters denote arguments like file or directory names.

command function
help COMMAND display information about COMMAND
cd PATH change the current directory
C:, D: change the current directory to the C: or D: device
dir PATH list files in the directory
cp FILE1 FILE2 copy FILE1 to FILE2
del FILE delete FILE
ren FILE1 FILE2 rename FILE1 into FILE2
mkdir DIR create a new directory DIR
rmdir DIR remove the (empty) directory DIR
type FILE display the content of FILE on the screen
more FILE display the content of FILE, stepping through the pages
set VAR=VALUE set the value of the variable VAR to VALUE
echo %VAR% display the value of variable VAL
set show the values of all variables
%1, .. %9 command line arguments of a batch command
if, for, goto control the program flow in a batch file
rem ignore this line - it's a comment

DOS and Windows don't distinguish between lower and upper case. File names can contain upper and lower letters, but small.txt and SmAlL.TxT denote the same file.

Many DOS commands use the symbols ? or * as placeholder (``wild card'') for exactly one letter or an arbitrary number of letters.

ren *.txt *.bak

renames all files ending with .txt into corresponding names ending with .bak.

The screen output of a command can be redirected into a file with the symbol >. Similarly one can use < to read the input for a command from a file. Using the ``pipe'' symbol | one can use the output of a command as input for another one. >> appends the command output to the given file.

dir *.exe >>liste.txt
help dir | more

previous    contents     next

Peter Junglas 8.3.2000