When you’re ready to dive a bit deeper into computer management, few skills are quicker and easier to learn than using Command Prompt. With it, you can run scans on your computer, adjust your networking, and input commands that you can’t do outside of this feature.
Whether you’ve never used Command Prompt before or are just getting started with it, check out some of the fantastic options it gives users.
What Exactly is Command Prompt?
Command Prompt is a tool for Windows users and a short term for Windows Command Processor. It’s a bit more advanced than automatic scans because you have to actually type in the correct command for what you want the program to do. If you have the right line, it should perform the task immediately.
The trick with Command Prompt is learning the kinds of tasks it can perform, how to input them, and in what order to use them. Once you have a handle on that, you can quickly look up other, more niche commands and input them without even knowing them in advance. It’s elementary after playing with it for a bit.
Where Did Command Prompt Come From?
Before operating systems were designed to be more user-friendly for a crowd that wasn’t as PC-savvy, they were run with a much different interface. Users had to input string commands to tell the computer what to do, which meant having a decent knowledge of how a computer functioned.
Command line strings of text would tell the computer what to do, and the computer would perform the task if the command were entered correctly.
Why Should I Use Command Prompt?
Command Prompt is helpful because you can quickly execute simple tasks without having to open a lot of other utilities. It can also run tasks there aren’t other utilities for, giving you more functionality. Without Command Prompt, troubleshooting would be a lot more complicated.
Another neat feature of Command Prompt is that it can run batch files. These are files with the
.bat extension that have a series of commands in them. Command Prompt runs through them one at a time. It’s a neat way to set up an automated series of tasks that you run regularly, so you don’t have to enter them into Command Prompt each time.
How to Open Command Prompt?
Before opening a Command Prompt window, there’s something you need to choose: normal or elevated command prompt.
A standard Command Prompt window has other programs’ normal permissions and settings. An elevated Command Prompt has administrator access. You probably want to use an elevated or administrative Command Prompt for troubleshooting.
Through Start Menu
You can open a Command Prompt window directly from the Start Menu. Each way you open it will also have the option to run it as an administrator.
- Press the Windows key.
- Decide whether you want to use an elevated or normal window. For a standard window, click Open in the right pane. For an elevated window, press Run as Administrator in the right pane.
- Click Yes to confirm that you want to use an elevated Command Prompt if prompted.
That’s one of the easiest ways to open a Command Prompt window, but there are others as well.
You can also open a Command Prompt from the Settings menu.
- Press the Windows key + X.
- Choose Command Prompt or Command Prompt (Admin).
- Click Yes if prompted.
If you don’t see this option listed, you might see PowerShell instead. It’s a newer feature with more options, but not necessary for many users. You can replace its entry with Command Prompt if desired.
- Press the Windows key + X.
- Choose Settings.
- Choose Personalization.
- Click Taskbar in the left pane.
- Move the slider to the Off position by “Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Windows key +X.”
Now the Command Prompt option will appear instead of the PowerShell menu.
Through Run Menu
You can also open it from the Run menu.
- Press the Windows key + R.
- Type “
cmd” without quotes.
- Press Enter.
The Command Prompt window will appear immediately.
Command Prompt Usage
Now you have Command Prompt open and just have to know what to do with it. Here are a few things to try out.
You can find help right in the Command Prompt menu by typing “help” without quotes and then pressing Enter. When you do, many commands will appear.
Once you see a command you want to know more about, type the command followed by
/? for more information. Take your time and read through these because while not all of them will apply to you, they could become helpful in the future. Here are some highlights from the taskkill option:
- If there’s too much information on the Command Prompt screen and you want to start fresh, type “
cls” and it will all disappear.
- To close Command Prompt, type “
exit” and press Enter.
- The command “
start” will open a new Command Prompt window.
- You can close programs from Command Prompt with the “
- The “
type” command will show the contents of a text file in the window.
- Type “
tasklist” to get a list of all currently running tasks and services.
- Type “
systeminfo” to see detailed information about your system.
You can use these to refine what you’re doing and get more utility out of your Command Prompt entries.
A few different troubleshooting utilities can be activated through Command Prompt. These are extremely useful when you’re having problems with your computer and trying to find the source of those issues.
- CHKDSK: If there’s a problem with your hard disks, the CHKDSK utility is a fantastic one to use via Command Prompt. It checks your disks for failures and attempts to repair them. The scan does require you to shut down your computer, and then it starts. The base command is
- System File Checker: This utility checks your Windows system files for corrupt or missing files. It may be able to fix itself with the scan, but there’s a chance you may have to do active repairs depending on what’s missing. The base command is
- Hardware and Devices Troubleshooter: This used to be available as a scan in Windows, but it was removed. Now you have to use Command Prompt to access it. It checks hardware and connected devices for problems and attempts to fix them. The base command is
msdt.exe -id DeviceDiagnostic.
One of the best types of commands to know for networking issues is how to release and renew your IP address. It can help fix problems with your network connection.
Here’s an excellent procedure to get started. Enter each of these commands, press Enter after each one, and wait for it to process before starting the next.
netsh winsock reset
This is one of the procedures I like to put into a .bat file so that I can run it all at once because I use it regularly. It flushes and resets the DNS connection.
Many PC users also use a Command Prompt window to perform disk management processes, like wiping or partitioning a hard drive.
Parameters are instructions you add to the command line to tell it what to do. For example, the command taskkill is the base command to close a program. But there are many parameters to help you decide where and how to do that.
/stells the command what system to connect to, if necessary.
/udenotes the user context under which the command should execute.
/pgives a password if needed.
/FIlets the user specify a filter.
Each command you have will also have associated parameters. If you type /? after you input a command, then it should give you a list of parameters that work with it.
Creating BAT Files
If you find yourself repeating a process many times, a batch file can help take some of the work out of it. It’s a simple text document with a series of commands designed to be input into Command Prompt. If you use Command Prompt regularly,
.bat files are a great way to streamline it.
Here’s how to make a batch file for network troubleshooting.
- Open a new Notepad document.
- Type in each command in order without any other text. It should only be the command.
netsh winsock reset
- Save the file and make the name
Network.bat. You can change the first word, but it has to have a
.batfile at the end.
- Right-click the saved file in the folder where it was saved and choose Run as Administrator.
- Confirm you want to run it as an administrator.
- Wait for the process to complete.
This is a straightforward batch file. You can make much more complicated ones to help streamline a lot of what you do on your PC. Much like Command Prompt itself, batch files take a little work to learn but will make you a much more active and knowledgeable user of your computer.