Comprehensive Guide To MS-DOS Commands: Description Syntax

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Comprehensive Guide to MS-DOS

Commands

Introduction

This document provides an extensive overview of common MS-DOS commands, including


their syntax, attributes, descriptions, and examples.

DIR

Description: Lists the contents of a directory, showing files and subdirectories.


Syntax:
DIR [ drive :][ path ][ filename ] [/ options ]

Attributes:

• /W: Displays in a wide format.

• /P: Pauses after each screen of information.

• /S: Lists files in subdirectories.

• /B: Outputs in bare format.

• /O: Sorts the output.

• /A: Displays files with specific attributes.

Example:
DIR C :\ Documents / W / P

1
CD (Change Directory)

Description: Changes the current working directory.


Syntax:
CD [ drive :][ path ]

Example:
CD C :\ Program Files

MD (Make Directory)

Description: Creates a new directory.


Syntax:
MD [ directory ]

Example:
MD NewFolder

RD (Remove Directory)

Description: Deletes a specified directory.


Syntax:
RD [ directory ]

Example:
RD OldFolder

COPY

Description: Copies files from one location to another.


Syntax:
COPY [ source ] [ destination ] [/ Y ]

Attributes:

2
• /Y: Suppresses confirmation prompts.

• /V: Verifies new files.

• /A: Indicates an ASCII file.

• /B: Indicates a binary file.

Example:
COPY file . txt D :\ Backup / Y

DEL (Delete)

Description: Deletes one or more files.


Syntax:
DEL [ filename ] [/ P ]

Attributes:

• /P: Prompts for confirmation.

• /F: Forces deletion of read-only files.

• /S: Deletes from all subdirectories.

• /Q: Quiet mode; no confirmation.

Example:
DEL oldfile . txt / P

REN (Rename)

Description: Renames a specified file or directory.


Syntax:
REN [ oldname ] [ newname ]

Example:
REN oldfile . txt newfile . txt

3
MOVE

Description: Moves one or more files.


Syntax:
MOVE [ source ] [ destination ]

Example:
MOVE file . txt D :\ Documents

XCOPY

Description: Copies files and directory trees.


Syntax:
XCOPY [ source ] [ destination ] [/ S ] [/ E ]

Attributes:

• /S: Copies directories except empty ones.

• /E: Copies all subdirectories.

• /H: Copies hidden files.

• /I: Creates destination as a directory if it does not exist.

• /Y: Suppresses overwriting prompts.

Example:
XCOPY C :\ Data D :\ Backup / S / E

ATTRIB

Description: Displays or changes file attributes.


Syntax:
ATTRIB [+ R | - R ] [+ A | - A ] [+ S | - S ] [+ H | - H ] [ filename ]

Attributes:

4
• +R: Sets the read-only attribute.

• -R: Clears the read-only attribute.

• +A: Sets the archive attribute.

• -A: Clears the archive attribute.

• +S: Sets the system attribute.

• -S: Clears the system attribute.

• +H: Sets the hidden attribute.

• -H: Clears the hidden attribute.

Example:
ATTRIB + H secret . txt

CHKDSK

Description: Checks a disk for errors.


Syntax:
CHKDSK [ drive :] [/ F ]

Attributes:

• /F: Fixes errors on the disk.

• /R: Locates bad sectors.

• /X: Forces volume dismount.

Example:
CHKDSK C : / F

FORMAT

Description: Prepares a disk for use.


Syntax:
FORMAT [ drive :] [/ FS : file_system ] [/ Q ]

5
Attributes:

• /FS:files ystem : Specif iesthef ilesystem./Q : P erf ormsaquickf ormat. Example:


FORMAT D : / FS : FAT32 / Q

DISKCOPY

Description: Copies the entire contents of one floppy disk to another.


Syntax:
DISKCOPY [ source_drive :] [ destination_drive :]

Example:
DISKCOPY A : B :

PING

Description: Tests network connectivity.


Syntax:
PING [ hostname or IP address ]

Attributes:

• -t: Pings until stopped.

• -n count: Number of echo requests.

• -l size: Size of the send buffer.

Example:
PING google . com

TRACERT

Description: Traces the route taken by packets to a specified network host.


Syntax:

6
TRACERT [ hostname or IP address ]

Attributes:

• -d: Prevents the resolution of IP addresses to hostnames.

• -h maxhops: Specifies the maximum number of hops to search for the target.

Example:
TRACERT google . com

NETSTAT

Description: Displays active network connections, routing tables, and network interface
statistics.
Syntax:
NETSTAT [/ options ]

Attributes:

• -a: Displays all active connections and listening ports.

• -n: Shows addresses and port numbers in numerical form.

• -o: Displays the owning process ID associated with each connection.

• -r: Displays the routing table.

Example:
NETSTAT -a -n

IPCONFIG

Description: Displays IP configuration information for network interfaces.


Syntax:
IPCONFIG [/ all ] [/ release ] [/ renew ] [/ flushdns ] [/ displaydns ]
[/ registerdns ]

7
Attributes:

• /all: Displays full configuration information.

• /release: Releases the current DHCP configuration.

• /renew: Renews DHCP configuration.

• /flushdns: Clears the DNS resolver cache.

• /displaydns: Displays the contents of the DNS resolver cache.

• /registerdns: Refreshes all DHCP leases and re-registers DNS names.

Example:
IPCONFIG / all

NET

Description: Performs various networking tasks, such as managing users, groups, and
services.
Syntax:
NET [ command ] [/ options ]

Common Commands:

• NET USER: Manages user accounts.

• NET SHARE: Manages shared resources.

• NET USE: Connects or disconnects from a shared resource.

• NET TIME: Displays or synchronizes the computer’s clock with another computer.

Example:
NET USER

SYSTEMINFO

Description: Displays detailed configuration information about the computer and its
operating system.
Syntax:

8
SYSTEMINFO

Example:
SYSTEMINFO

SHUTDOWN

Description: Allows you to shut down or restart the computer.


Syntax:
SHUTDOWN [/ s | / r | / l ] [/ t seconds ] [/ f ] [/ m \\ computername ]

Attributes:

• /s: Shuts down the computer.

• /r: Restarts the computer.

• /l: Logs off the current user.

• /t seconds: Sets a timer for shutdown (default is 30 seconds).

• /f: Forces running applications to close.

• /m
computername: Specifies the target computer for shutdown or restart.

Example:
SHUTDOWN / r / t 60

FC (File Compare)

Description: Compares two files or sets of files and displays the differences.
Syntax:
FC [ filename1 ] [ filename2 ] [/ B ] [/ C ]

Attributes:

• /B: Performs a binary comparison.

9
• /C: Ignores case differences.

• /L: Compares files as ASCII text.

Example:
FC file1 . txt file2 . txt / C

SET

Description: Displays, sets, or removes environment variables in the command prompt.


Syntax:
SET [ variable =[ string ]]

Example:
SET MY_VAR = HelloWorld

ECHO

Description: Displays messages or turns command echoing on or off.


Syntax:
ECHO [ message ]

Attributes:

• ON: Turns command echoing on.

• OFF: Turns command echoing off.

Example:
ECHO Hello , World !

CLS

Description: Clears the command prompt screen.


Syntax:

10
CLS

Example:
CLS

EXIT

Description: Exits the command prompt or closes the current batch script.
Syntax:
EXIT

Example:
EXIT

Conclusion

This guide provides a comprehensive overview of commonly used MS-DOS commands,


along with their syntax, attributes, and practical examples. By familiarizing yourself
with these commands, you can efficiently navigate and manage tasks in the MS-DOS
environment. For further exploration, refer to official documentation or resources specific
to your version of Windows.

11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy