Comprehensive Guide To MS-DOS Commands: Description Syntax
Comprehensive Guide To MS-DOS Commands: Description Syntax
Comprehensive Guide To MS-DOS Commands: Description Syntax
Commands
Introduction
DIR
Attributes:
Example:
DIR C :\ Documents / W / P
1
CD (Change Directory)
Example:
CD C :\ Program Files
MD (Make Directory)
Example:
MD NewFolder
RD (Remove Directory)
Example:
RD OldFolder
COPY
Attributes:
2
• /Y: Suppresses confirmation prompts.
Example:
COPY file . txt D :\ Backup / Y
DEL (Delete)
Attributes:
Example:
DEL oldfile . txt / P
REN (Rename)
Example:
REN oldfile . txt newfile . txt
3
MOVE
Example:
MOVE file . txt D :\ Documents
XCOPY
Attributes:
Example:
XCOPY C :\ Data D :\ Backup / S / E
ATTRIB
Attributes:
4
• +R: Sets the read-only attribute.
Example:
ATTRIB + H secret . txt
CHKDSK
Attributes:
Example:
CHKDSK C : / F
FORMAT
5
Attributes:
DISKCOPY
Example:
DISKCOPY A : B :
PING
Attributes:
Example:
PING google . com
TRACERT
6
TRACERT [ hostname or IP address ]
Attributes:
• -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:
Example:
NETSTAT -a -n
IPCONFIG
7
Attributes:
Example:
IPCONFIG / all
NET
Description: Performs various networking tasks, such as managing users, groups, and
services.
Syntax:
NET [ command ] [/ options ]
Common Commands:
• 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
Attributes:
• /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:
9
• /C: Ignores case differences.
Example:
FC file1 . txt file2 . txt / C
SET
Example:
SET MY_VAR = HelloWorld
ECHO
Attributes:
Example:
ECHO Hello , World !
CLS
10
CLS
Example:
CLS
EXIT
Description: Exits the command prompt or closes the current batch script.
Syntax:
EXIT
Example:
EXIT
Conclusion
11