The Most Important MS-DOS Commands

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

basic MS-DOS commands

Open the command prompt by entering cmd under Start – Run. Here you can now use the following MS-DOS commands:

  1. 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.
  2. CD: Changes the directory.
    Example: cd C:\Programs changes to the “Programs” directory on the C: drive.
  3. MD: Creates a new directory.
    Example: md C:\NewFolder creates a new directory named NewFolder on the C: drive.
  4. RD: Removes a directory.
    For example: rd C:\OldFolder removes the OldFolder directory on the C: drive.
  5. 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.
  6. DEL: Deletes one or more files.
    Example: del C:\Temp*.tmp deletes all files with the extension .tmp in the directory C:\Temp.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. FORMAT: Format a floppy disk or hard disk.
    Example: format C: formats the C: drive.
  12. 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.
  13. 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.
  14. FDISK: Manages hard disk partitioning.
    Example: fdisk /mbr restores the Master Boot Record (MBR) on the hard drive.
  15. 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.
  16. NETSTAT: Displays information about active network connections.
    Example: netstat -a shows all active network connections and their status.
  17. 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.
  18. 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.
  19. FORMAT: Format a floppy disk or hard disk.
    Example: format D: /q /u will format drive D: with quick format and erase all data.
  20. LABEL: Assigns a label to a volume.
    Example: label C: System gives the C: drive the label “System”.
  21. 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.
  22. SCANDISK: Checks and repairs hard disk errors.
    Example: scandisk C: checks the C: drive for errors and repairs them if there are any.
  23. 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” .
  24. 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”.
  25. TIME: Displays or sets the current system time.
    Example: time 12:00:00 sets the system time to 12:00:00.
  26. VER: Displays the version of MS-DOS.
    Example: ver shows the version of MS-DOS that is installed on your computer.
  27. VOL: Displays the volume label of a disk.
    Example: vol C: shows the volume label of the C: drive.
  28. ASSOC: Shows the association between file extensions and file types.
    Example: assoc .txt displays the file type associated with the .txt extension.
  29. 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.

More Like This

How to Play MS-DOS Games Online for Free

In the early years of personal computers, when operating systems did not yet have a graphical interface, all games were run from MS-DOS. The process...