0% found this document useful (0 votes)
38 views3 pages

CMD Commands 1

The document describes the syntax and usage of common internal commands in DOS/Windows including TIME, DATE, CLS, DIR, COPY, TYPE, DEL, REN, MD, RD, and CD. TIME and DATE display or set the system time and date. CLS clears the screen. DIR displays directory listings. COPY copies files. TYPE displays file contents. DEL deletes files. REN renames files. MD makes new directories. RD removes empty directories. CD changes the current directory. Examples of using each command are provided.

Uploaded by

Siddhesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

CMD Commands 1

The document describes the syntax and usage of common internal commands in DOS/Windows including TIME, DATE, CLS, DIR, COPY, TYPE, DEL, REN, MD, RD, and CD. TIME and DATE display or set the system time and date. CLS clears the screen. DIR displays directory listings. COPY copies files. TYPE displays file contents. DEL deletes files. REN renames files. MD makes new directories. RD removes empty directories. CD changes the current directory. Examples of using each command are provided.

Uploaded by

Siddhesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

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)

You might also like