Real MS-DOS is no longer available in today’s versions of Windows. The latest version is MS-DOS 8.00. It has been used to create startup disks since Windows XP. Nothing has changed in the version to this day. And let’s be honest, which computer still has a floppy disk drive?
However, it still makes sense to know the most important and most frequently used MS-DOS commands because Windows offers the possibility of using these MS-DOS commands with the command prompt.
The most important MS-DOS commands at a glance
Open the command prompt by entering cmd under Start – Run. Here you can now use the following MS-DOS commands:
- DIR: Displays the contents of the current directory.
Example: dir /w displays the contents of the current directory with a column width of 80 characters. - CD: Changes the directory.
Example: cd C:\Programs changes to the “Programs” directory on the C: drive. - MD: Creates a new directory.
Example: md C:\NewFolder creates a new directory named NewFolder on the C: drive. - RD: Removes a directory.
For example: rd C:\OldFolder removes the OldFolder directory on the C: drive. - COPY: Copies one or more files from one location to another.
Example: copy C:\Documents\MyDocument.txt D:\Backup\MyDocument.txt copies the file “MyDocument.txt” from C:\Documents\ to drive D:\Backup. - DEL: Deletes one or more files.
Example: del C:\Temp*.tmp deletes all files with the extension .tmp in the directory C:\Temp. - TYPE: Displays the content of a text file.
Example: type C:\Documents\MyDocument.txt shows the content of the text file “MyDocument.txt” in the directory C:\Documents. - REN: Renames a file.
Example: ren C:\Documents\OldName.txt NewName.txt renames the file OldName.txt to NewName.txt in the C:\Documents\ directory. - ATTRIB: Shows or changes the attributes of files or directories.
Example: attrib +r C:\Documents\MyDocument.txt sets the attribute “Read-only” for the file “MyDocument.txt” in the directory C:\Documents. - CHKDSK: Checks and repairs errors on the hard disk.
Example: chkdsk C: /f checks the C: drive for errors and repairs them if there are any. - FORMAT: Format a floppy disk or hard disk.
Example: format C: formats the C: drive. - XCOPY: Copies files and folders and keeps the original attributes.
Example: xcopy C:\Documents D:\Backup /s /e /h copies directory C:\Documents\ to drive D:\Backup\ and all subdirectories and files including hidden files. - TREE: Displays a visual representation of the directory tree.
Example: tree /f displays a list of all files and directories in the current directory and all subdirectories. - FDISK: Manages hard disk partitioning.
Example: fdisk /mbr restores the Master Boot Record (MBR) on the hard drive. - IPCONFIG: Displays information about the network configuration.
Example: ipconfig /all displays the IP address, subnet mask value, default gateway, and DNS server address for all network adapters. - NETSTAT: Displays information about active network connections.
Example: netstat -a shows all active network connections and their status. - PING: Tests the connection to another computer on the network.
Example: ping 192.168.0.1 tests the connection to the computer with the IP address 192.168.0.1. - TRACERT: Traces a packet’s path through the network.
Example: tracert www.google.com shows the path a packet takes from your computer to Google servers. - FORMAT: Format a floppy disk or hard disk.
Example: format D: /q /u will format drive D: with quick format and erase all data. - LABEL: Assigns a label to a volume.
Example: label C: System gives the C: drive the label “System”. - MEM: Displays memory space and usage.
Example: mem /c shows the free and used memory space as well as the memory requirements for the various device drivers. - SCANDISK: Checks and repairs hard disk errors.
Example: scandisk C: checks the C: drive for errors and repairs them if there are any. - SORT: Sorts the content of a text file.
Example: sort C:\Documents\Unsorted.txt > C:\Documents\Sorted.txt sorts the contents of the file “Unsorted.txt” in the directory C:\Documents\ and saves the sorted output in the file “Sorted.txt” . - SET: Sets environment variables or displays their value.
Example: set PATH=C:\Programs;C:\Windows\System32 sets the value of the PATH environment variable to “C:\Programs;C:\Windows\System32”. - TIME: Displays or sets the current system time.
Example: time 12:00:00 sets the system time to 12:00:00. - VER: Displays the version of MS-DOS.
Example: ver shows the version of MS-DOS that is installed on your computer. - VOL: Displays the volume label of a disk.
Example: vol C: shows the volume label of the C: drive. - ASSOC: Shows the association between file extensions and file types.
Example: assoc .txt displays the file type associated with the .txt extension. - EXIT: Exits the MS-DOS prompt.
Example: exit exits the MS-DOS prompt and returns to the normal operating system.
To interrupt the processing of a command, you can use the key combination CTRL and C. To close the command prompt, enter the exit command.