Useful DOS Commands:

 

FILE OPERATIONS

dir

display a directory (use /p switch to view one page at a time)

cd <directory>

change directory

copy <file1> <file1>

copy a file from <file1> to <file2>

del <filename>

delete a file

ren <filename>

rename a file

md <dir name>

make a directory

rd <dir name>

remove a directory

attrib [+|- {r,a,s,h}] <file>

change/view attributes on a file

r = read-only

a = archive

s = system

h = hidden

xcopy <source><target>

Selectively copy files

Switches for use with xcopy:

/A - copy only files with archive attribute set (leaves it set)

/M - copy only files with archive attribute set (turns it off)

/E - copy all subdirectories in <source> to <target> even if they are empty. Must be used with /S

/P - prompt for comfirmation

/S - copy all subdirectories in <source> except empty ones

/W - wait for keypress to begin

/D <date> - only copies modified on or after <date>