The syntax for some frequently used internal commands follows.
TIME
Displays current time and allows it to be changed.
Syntax:
TIME
DATE
Displays current date and allows it to be changed.
Syntax:
DATE
CLS
Clears the screen.
Syntax:
CLS
DIR
Shows directory information of a diskette: name, size, and the date and
time stamp of files.
Syntax:
DIR [d:][path]
Optional switches:
/p Display dir info and pauses display when the screen is full
/w Display names and extensions only in five columns
To display a file directory listing for D:\DATA\LETTER\ANNUAL from
different current directories:
D:\DATA\LETTER\ANNUAL> DIR
D:\DATA> DIR LETTER\ANNUAL
C:\WINDOWS> DIR D:\DATA\LETTER\ANNUAL
COPY
Copies a file. Name of copy may be the same as original, or different.
Syntax:
COPY [d:][path][name.ext] [d:][path][name.ext]
Optional switches:
/v Verify, copies the file and compares it with the original
/b Binary file
To copy a file from D:\BATCH to the root of A: drive
A:\> COPY D:\BATCH\CL.BAT (from A: drive)
D:\BATCH> COPY CL.BAT A:\ (from D:\BATCH)
To copy a file from the root of C: to A: drive and change its name
A:\> COPY C:\MSDOS.SYS MSDOSSYS.BAK (from A:)
C:\> COPY MSDOS.SYS A:\MSDOSSYS.BAK (from the root of C:)
To copy all of the files from the root of A: to D:\CCV\ENGCOMP
A:\> COPY *.* D:\CCV\ENGCOMP (from A:)
D:\CCV\ENGCOMP> COPY *.* A:\ (from D:\CCV\ENGCOMP)
TYPE
Displays the contents of a file.
Syntax:
TYPE [d:][path][name.ext]
To display the contents of the file MY.LET to the screen
A:\> TYPE MY.LET
DEL
Deletes a file from disk.
Syntax:
DEL [d:][path][name.ext]
To delete one file:
A:\> DEL A:\MY.LET
To del all files in current directory
A:\> DEL *.*
REN
Renames a file.
Syntax:
REN [d:][path][name.ext] [d:][path][newname.ext]
To change the name of the file D:\LET\ANNUAL\99.DOC to 1999.DOC
D:\LET> REN ANNUAL\99.DOC 1999.DOC (from D:\LET)
D:\DATA> REN \LET\ANNUAL\99.DOC 1999.DOC (from D:\DATA)
C:\WINDOWS> REN D:\LET\ANNUAL\99.DOC 1999.DOC (from C:\WINDOWS)
MD
Makes (creates) a new directory.
Syntax:
MD [d:][path][dirname]
To create a directory named HERMIT in the root of D: drive
D:\> MD HERMIT (from D:\)
C:\> MD D:\HERMIT (from C:\)
RD
Removes an existing directory (directory must be empty).
Syntax:
RD [d:][path][dirname]
To remove the HERMIT sub-directory:
D:\> RD HERMIT (from D:\)
C:\> RD D:\HERMIT (from C:\)
CD
Changes the current directory.
Syntax:
CD [path][dirname]
To make D:\HERMIT the current directory
D:\> CD HERMIT (from D:\)
D:\DATA> CD \HERMIT (from D:\DATA)
D:\DATA\SOURCE> CD \HERMIT (from D:\DATA\SOURCE)
D:\DATA\SOURCE> CD .. (from D:\DATA\SOURCE)