MS-DOS and Windows Command Line: Essential Commands and How to Use Them

The command line is an effective way of handling files, system information, and solving computer-related problems. Most users of Windows prefer using the graphical menu. The user is able to do all sorts of activities through typing a few instructions in command-line tools.

Understanding MS-DOS and command lines of Windows will assist you in navigating files and folders, copying files, connecting to networks, and understanding the workings of computers. Most commands of the conventional DOS are supported in the Windows CMD. What Is MS-DOS and Windows Command Prompt?

MS-DOS is an abbreviation of Microsoft Disk Operating System. This is a legacy operating system which provided the ability for users to handle their files and execute programs using text commands.

Command Prompt is a command interpreter software found in recent versions of Windows. While it includes a lot of the DOS commands, it is not equivalent to the MS-DOS operating system itself.

How to Open Command Prompt

Here is how to launch CMD:

Some commands need administrator privileges. Run as administrator should be used selectively.

Important MS-DOS Commands

Following are some commonly used MS-DOS and Windows command line commands.


1. DIR: Display Files and Folders

The dir command shows files and folders present in the current directory.

dir

To display text files, type dir *.txt. The use of this command assists in finding files without using File Explorer.

2. CD: Change Directory

This command lets you switch between directories.

cd Documents

To switch up one level, type:

cd ..

To go back to the root directory of the drive, use cd \.


3. MKDIR: Creating a Folder

Use mkdir command to create a folder.

mkdir Projects

A folder named “Projects” will be created in the current location.


4. COPY: Copying Files

This is the command used to copy a file.

copy report.txt D:\Backup\

This command will copy report.txt to the Backup folder on drive D.


5. MOVE: Move Files

The move command is used to move a file to another directory.

move report.txt D:\Documents\

It is helpful in managing documents and files.

6. DEL: Deleting Files

Using del command, you can delete files from a directory.

del oldfile.txt

Be very careful about the name and location of the file because the files that are deleted cannot be recovered from the Recycle Bin.


7. REN: Rename Files

Using ren for renaming files.

ren draft.txt final.txt

This will rename draft.txt file to final.txt file.


8. CLS: Clear the Screen

This instruction clears the screen of the visible Command Prompt.

cls

It ensures that the command prompt window remains clean while executing several commands.

Useful Windows CMD Commands

Windows CMD has many commands that may come in handy for troubleshooting.

IPCONFIG: Review Network Information

The ipconfig utility provides basic network configuration details.

ipconfig

To get further information on network adapter details and DNS information, use ipconfig /all.

Ping: Check for Network Connectivity

The ping utility tests whether the target is responsive to network queries.

ping example.com

It may be useful when troubleshooting any connectivity issues. But some devices will refuse the request, which does not necessarily imply that the target is unavailable.

SYSTEMINFO: Display System Information

This command will display the information regarding your computer as well as your Windows installation.

systeminfo

This command is useful while troubleshooting your computer or before contacting technical support.

CHKDSK: Check a Disk Drive

This command checks the file system on a drive and returns any particular errors.

chkdsk C:

Prior to any repair, backup your data and choose the right options based on your situation.


Basic Command Line Concepts for Beginners

The following advice may help make using CMD more efficient and secure.


Command-line Errors to Watch Out For

Always double-check your command for any typographical errors, file names, and any other options before hitting Enter. One minor error could mean something totally different.

Do not copy any commands from sites you don’t know, particularly when you’re deleting something. Also, do not run commands for formatting the disk or anything else that may need admin rights.

Try using test files first and always have a backup of your valuable files. Note that there are some differences between classic MS-DOS and Windows command lines.

Conclusion

Having knowledge of some of the commands that one may use in MS-DOS and Windows command prompt makes it easier to perform computer functions.

Use simple commands and practise them often. Having basic skills in CMD will enable you to be able to move through directories, organize your files and run tests on your computer systems.


Was this page useful?