DOS commands to be used in a Command Prompt Window.
DOS means Disk Operating System.
The terms folder and directory mean the same thing.
Instead of a single filename, a filename with the wildcard character * can be entered. For example,
*.txt
matches all files with a .txt extension.
The symbol .. means the parent of the current directory
CLS - Clear screen
ECHO - Echo a string to the screen
EXIT - Close Command Prompt Window
HELP -List information about DOS commands
TYPE filename - Type contents of file at screen
DIR - Show all files in current directory
DIR [file.ext] - Displays the contents of the current (default) directory.
DIR/S [file.ext] - Displays the contents of the current (default) directory and all
subdirectories below it.
MKDIR or MD path - Create a subdirectory. Stands for Make Directory. If no path is given,
it
assumes the directory should be created under the current (default) directory.
RMDIR or RD path - Delete a subdirectory. Stands for Remove Directory. If no path is
given,
it assumes the directory should be created under the current (default) directory. DirectoryMUST be
empty to be able to be deleted.
COPY sourcefile targetfile - Copies a file (sourcefile) to a destination (targetfile).
CD [path] - Changes the current (default) directory to the given path.
CD.. - Changes the current (default) directory to the parent directory of the current
(default) directory.
CD\ - Changes the current (default) directory to the root directory of the current drive.
DEL [file.ext] - Delete a specific file(s).
DOSKEY - Loads the Doskey program into memory. The Doskey program recalls MS-DOS
commands and enables you to edit command lines and create and run macros. Use the UPARROW
to recall the list of previously entered commands one by one.
MEM - Displays the amount of used and free memory on your computer. You can use the
MEM command to display information about allocated memory areas, free memory areas,
and programs that are currently loaded into memory.
RENAME file.ext newfile.ext - Renames a file (file.ext) to a new name and/or ext
(newfile.ext).
The symbol > redirects screen output to a textfile.
dir > dir.txt
type dir.txt
echo This is a test string > test.txt
type test.txt
The symbol >> appends screen output to an existing textfile.
dir > out.txt
echo This is a test string >> out.txt
type out.txt
An alternative to typing DOS comments in the Command Prompt Window is to create
a .bat file thatcontains DOS comments. The commands in the .bat file are then
executed by simply typing the name ofthe batch file.