DOS (Disk Operating System) was one of the most usable operating systems during the initial period of personal computer’s emergence into homes and offices. MS-DOS is Microsoft’s version of DOS which is integrated into most of their operating systems, including Windows 8. I will be talking about common DOS commands in this post.
Technically speaking, MS-DOS is a command-line operating system that allows you to perform various tasks according to given commands. There is no GUI (Graphical User Interface) here, however it is a lot fun to play. Thus I have compiled this post explaining the most useful MS-DOS commands.
Starting the Windows command prompt
It is quite easy to open the windows command prompt. Hit the ‘Windows key’ along with ‘r’ key to get the run dialogue box [windows key + r].
Simply type ‘cmd’ there and hit enter. Now you should see the command prompt window opened. Little jargon buster here – Command line prompt is the prompt that you see in below window – c:\>_
10 Most common DOS Commands – Good to know
-
Ping
Ping is my favorite command of all. I use it to check my internet connection when I find difficulty in connecting to the internet. What ping does is simple. It pings a website from your computer, i.e. this command sends a packet of data to a destination site and it is returned back to you, thus proving that you have established a connection.
For instance consider the command –
Ping www.google.com
This command would send a packet of data to the server pointed by Google.com and it is returned back to you. There are various options for this command to change that number of packets sent and so on. To view the entire list of options -type ping /?
Data default length in bytes is 32, can be modified to 65527 for a particular ping.Packet of such large size can be sent if it is fragmented
In simple terms it is a method to check, whether your computer can communicate with another computer over a network.
In the newer version of computers running on IPV6, you may see IP version something similar to [ke75::48c1:3214:a16e:8dec%13] to get the IPV4 address use the below command.
Ping -4, similarly replacing “-4” with “-6” will force the ping command to use ipv6 only, both are only necessary when pinging a hostname.( Refers to home page url)
Usability of Ping – To check the reachability of the host and the round trip time.It is a useful dos command, helps in basic level trouble shooting.
-
Ipconfig
This is a powerful MS-DOS command to view your network status and also perform operations on the same. For instance, you can view your IP-address, subnet mask and much more. Once you type this command, make sure you scroll down if you are looking for a particular information. The following are the parameters that you can use with this command.
If you are having problems connecting to the internet, just use the first three commands given below to renew your IP address. It may solve the problem. 🙂
- Ipconfig /flushdns
This command removes the DNS (Domain Name System) records in your system.
- Ipconfig/release
It releases or removes the IP address assigned to your system
- Ipconfig /renew
Finally, with this command, you will be assigned a new IP
- Ipconfig /all
This command displays all the configurations of your network card
Usability of ipconfig – Displays IP address, subnet mask and default gateway for all adapters. You can also use it to release and renew your IP, if your internet is not working properly.
-
Chkdsk
Chkdsk stands for ‘check disk’. It checks your disks drives and finds errors. You can also repair your affected disk drives with this command using the “/f “ options, which will fix your drive.
Before that, you need to have administrative privileges to use this command. For that, run cmd as administrator, by right clicking it on start and selecting “run as administrator” [windows 7]. Follow same procedure on Windows 8, i.e. search for cmd and right click on it.
chkdsk drive name:
You may follow another process – From the start menu – search for command prompt, click right and choose the option “ run as administrator”
You will get to see administrator command prompt, where you can type – chkdsk and enter. By default chkdsk operates on current disk, if you want to check your D drive type –chkdsk D: and press enter.
If you want chkdsk to also fix the error in a drive – type chkdsk D: /F , ‘F’ here means ‘Fix’ parameter.
Usability of Chkdsk – Primary use of chkdsk command is to check that all the information stored in files, folders on the disk is correct and repair the disk for errors.
-
TraceRT
This command will trace the path of packets to a particular server of a website or IP.
Tracert www. google.com : Using this MS-DOS command, you can know the path travelled by your packets when it needs to get to Google.com. You can track the timings of each hop, which can help in identifying the source of delay in reaching the server.
Usability of tracert – To visually see the packet data being sent and received and the amount of hops required for the packets to reach its destination. For academic purpose, it is good to learn how traceroute works.
-
Netstat
This is another network command, unofficially short term for network statistics. It lists the status of your network, the number of active connections and open ports in your system currently along with their current states. It’s popular usage among administrators is to detect computer system for spyware or Trojan. This can also detect the ports for which a computer is listening for incoming connections.
There are number of reasons for which netstat is used – some of them include – identifying open ports which may indicate Trojan’s waiting for instructions from remote system. Number of errors when trying to reach remote server can be identified. One of the reasons for its gaining popularity is it’s inclusion in most of the operating systems like Linux, windows, Unix etc.
Users unfamiliar with netstat may type netstat/? And get manual with various options.
Usability of netstat dos command – Apart from malware identification, it can provide IP addresses of remote computer( S) to which socket was connected.
-
Help
The help command all the available commands that you can use in the MS-DOS prompt. You can try out the various commands in that list, but make sure you know what you are doing.
-
Format
Formatting a drive is quite easy with the ‘Format’ MS-DOS command. You can try this command when you have a defective USB flash drive or when you need to format a particular drive on your computer.
Format D: – This will format the D: drive
Purpose of format dos command – Use this command only if you wish to format or erase all the data from your computer. So taking back up of your data becomes important before using this command function of MS DOS.
-
Dir
This command will list the contents of the current directory you are in. It takes a lot of parameters like /t and /p which will list the files according to a particular criteria. You can get the list of options to use with this command by typing
dir /?
dir /t :lists file according to the time it was created
‘Dir’ command helps to know which directories have been created on specified disk. It also shows the last modified content date, time and file size.
-
SystemInfo
This is one of my much loved and common dos command. It gives you a detailed description about your system components like processor, memory and much more. You can also use it to check whether your system is 32 bit or 64 bit.
systeminfo : displays a report about your system’s components
-
Taskkill
The taskkill command in MS-DOS kills or terminates a running process. It can become handy when some of your programs freeze or when they stop responding.
Most of us are well versed with the process of killing a document using task manager but by using task manager you can’t kill multiple processes at the same time. Command line prompt through taskkill function allows you to kill multiple documents at the same time.
For instance if you have a process called notepad.exe that is not responding. Type the following command to terminate it forcefully. Do note that you will lose any data that the program (here notepad.exe) is holding.
In case you want to see a list of programs running in your system, use the following command.
Taskkill : lists the running processes at a time. For academic purpose, you may learn more on taskkill by clicking here. There are times when certain documents don’t respond, You need to exercise the option to save and close or force close the document.
Well, I think these are obviously the most useful MS-DOS commands you could find. Anyhow I want you to consider the following guidelines to make the most out of these commands.
- You can type the commands in lowercase or uppercase, no issues.
- Be cautious when you have opened the prompt as Administrator. Things can go wrong if not done in the right way.
- You may see an output that is different from the above screenshots. It’s quite natural, and systems differ in specs.
- You can view the help description for any command using the following format
command /?
For example, netstat /? Will return the help description for the netstat MS-DOS command.
Now it is time for you to get some fun playing with common MS-DOS commands. If you find any issues, let me know, and play safe! 🙂
The top 6 commands are highly recommended to check the status of your system, network and internet.