Before today I had to boot a client computer into safe mode and delete a virus via the command prompt considering whenever Windows would load, the file would go locked and hence undeletable! There are several other reasons why you may have to use the command prompt in your life (though rarely), so it'southward good to know how to navigate your way around!

If yous accept been pregnant to learn how to use the command prompt in Windows, I'll go through some of the bones commands that are performed most often. Just so everyone's on the same page, you tin can get to the control prompt by going to Beginning and then click on Run and typing in CMD. In Windows 7, only click on Start and brainstorm typing cmd. In Windows 8, you can just right-click on the Kickoff push and choose Command Prompt.

command prompt

windows 8 cmd

You'll now see a large black window with the cursor at the finish of the path to your user profile in C:\Documents and Settings\Username or C:\Users\Username. And so what to do at present!? Well, since I tin't explain everything, yous'll probably want to finish up using some of the assist guides that are provided in MS DOS itself by typing in HELP and pressing Enter.

When you do that, you'll become a list of all the commands you tin use in MS DOS and a short description of what they do:

ms dos

You can also find out more detailed information about the parameters and how to use each control by typing in the command name followed by a /?. For case, typing in CD /?, volition present y'all with a quick tutorial on how to use the CD command:

command promt commands

As you tin run across from higher up, the MS DOS command CD displays the proper name of or changes the current directory. So if you wanted to alter from the default user profile directory to the Windows System32 directory to delete a virus file, you would type in the following to navigate to that directory:

cd c:\window\system32 and press Enter

You current directory at the prompt will now change to:

ms dos commands

Now that you are in that directory, you may want to view all of the files and directories first, and then you tin blazon in the command DIR and press Enter. You'll now get a giant listing of all of the files and folders in that directory. Yous tin type in DIR /? and run across what parameters you lot tin pass to it.

dir ms dos command

As you can see, y'all could type in DIR /P to requite the listing in a paginated format that you can scan through slowly. Or yous could type in DIR /Westward to get the listing in a broad format rather than ane unmarried column. The cool affair nearly DOS is that y'all can include several parameters for each command, so you could type in DIR /P /W and get a page-past-page view forth with wide format:

dir dos command

Then at present that we have a list of files and folders, let's proceed with our deleting a virus case. If you want to delete a file, you would utilise the DEL command. Again typing in DEL /? will give you some useful info on the command.

delete files cmd

To delete a file, we can merely type in DEL filename and that will delete the file. When you utilize the command this manner, information technology won't prompt you to confirm before deleting the file, and then make sure y'all have typed in the right file name. As well, yous have to enter the file name with the extension, then information technology would be DEL Test.txt to delete that file. Also, if you need to delete a file that has spaces in the proper name, you have to utilize quotes similar DEL "This is a test.txt".

delete file cmd

If y'all need to create or delete folders, you would utilize the MKDIR and RMDIR commands. Information technology'southward worth noting that if yous try to delete a not-empty directory, you will go an error message. However, if yous are sure you want to delete the directory and everything inside, you tin apply the RMDIR /S foldername command.

rmdir command

There are lots of other commands that you tin use to do all sorts of stuff like copy files, print text files, change file permissions, etc. And so if you tin can do most of this stuff in Windows using the GUI interface, then why bother with DOS, correct?

Firstly, you lot never know when something bad will happen to Windows and you're stuck in the command prompt because aught else will load. Also, whatever command y'all type in the command prompt, like we showed above, can exist saved into a file with a .BAT extension and run anytime past just clicking on the file or can be scheduled to run using the Windows Scheduled Tasks Command Panel applet.

So if you want to be able to routinely perform some simple deportment on your computer, similar copying files from i folder to another, only type the commands into Notepad and salvage the file with a .BAT extension instead of as a text file. Basically, yous have to cull All Files for the File Type selection and so type in the name like "MyFile.bat" with the quotes included.

bat file

Let me mention a couple of other commands that prove to be very useful very often.

IPCONFIG

The IPCONFIG control gives you information about your network cards, IP addresses and also lets y'all renew your IP address. My favorite is ipconfig /all, which will give you detailed information most each network adapter on your computer. You lot tin can then use this info to figure out your router IP address (default gateway) and whether or not you're getting an IP address from a DHCP server.

ipconfig

DISKPART

Again, when you end up with hard drive problems, this command can prove to exist very useful. DISKPART lets you administer the hard disks installed on your computer. You can do things like set a partition to be the agile partition, assign a bulldoze letter to a segmentation, compress a deejay, take a disk offline or online, etc.

diskpart

SFC

System File Checker is really useful because it scans all protected system files and replaces incorrect versions with correct file versions. There will exist a lot of times when sure system files in Windows have become corrupt and system file checker volition fix them for you easily. You merely run sfc /scannow and it will perform a browse and gear up any issues. It does take quite a scrap of time, but worth it if you're having any kind of corruption issues.

A couple of other very useful commands that you might take to end up using are listed beneath:

  • chkdsk – Verifies a hard disk or a floppy deejay for file system integrity.
  • copy – Copies files from one location to another. The destination defaults to the current directory. If there are multiple source files, the destination must be a directory or else you will get an mistake.
  • fc – Compares two files or sets of files and displays the differences between them
  • fdisk – Manipulates hard disk division tables. When run from the command line, information technology displays a menu of diverse division operations.
  • format – Delete all the files on the disk and reformat it for MS-DOS. Use mostly for formatting floppy disks or other removable disks.
  • scandisk – Deejay diagnostic utility that is a replacement for the CHKDSK utility.
  • netstat – Shows you all the current connections from your local computer to anything external.

That should hopefully get yous up and running on how to use and navigate in the MS DOS command prompt! You can too check out this site that has a list of all commands yous can employ at the command prompt. If you have a question, delight post a comment! Bask!