- Command Prompt: What It Is and How to Use It
- Command Prompt is available in most Windows operating systems
- How to Access Command Prompt
- How to Use Command Prompt
- Command Prompt Commands
- Command Prompt Availability
- 27 Useful Windows Command Prompt Tricks You Might Not Know
- How To Use Command Prompt In Windows 10?
- 27 Useful Windows Command Prompt Tricks
- 1. Command History
- 2. Run multiple commands
- 3. Use Function keys and become a pro user
- 4. See PC driver list
- 5. Send output to clipboard
- 6. Abort a command
- 7. Make your Command Prompt colorful
- 8. Create Wi-Fi hotspot right from the command prompt
- If you’re using Windows 10?
- 9. Scan system files for problems
- 10. Start using batch files
- 11. Fix issues with DNS resolver cache
- CMD Alternative: Powershell and Windows Terminal
- Command Prompt: 11 basic commands you should know (cd, dir, mkdir, etc.)
- 1. How to change the directory (folder) in Command Prompt (CMD)
- 2. How to change the drive in Command Prompt (CMD)
- 3. How to view the contents of a directory in Command Prompt (CMD)
- 4. How to create a new directory with Command Prompt (CMD)
- 5. How to rename files and folders with Command Prompt (CMD)
Command Prompt: What It Is and How to Use It
Command Prompt is available in most Windows operating systems
Command Prompt is a command line interpreter application available in most Windows operating systems. It’s used to execute entered commands. Most of those commands automate tasks via scripts and batch files, perform advanced administrative functions, and troubleshoot or solve certain kinds of Windows issues.
Command Prompt is officially called Windows Command Processor, but it’s also sometimes referred to as the command shell or cmd prompt, or even by its filename, cmd.exe.
Command Prompt is sometimes incorrectly referred to as «the DOS prompt» or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS, but it’s not MS-DOS.
Cmd is also an abbreviation for many other technology terms like centralized message distribution, color monitor display, and common management database, but none of them have anything to do with Command Prompt.
How to Access Command Prompt
There are several ways to open Command Prompt, but the «normal» method is via the Command Prompt shortcut located in the Start menu or on the Apps screen, depending on your version of Windows.
The shortcut is faster for most people, but another way to access Command Prompt is via the cmd Run command. You can also open cmd.exe from its original location:
Yet another method for opening Command Prompt in some versions of Windows is through the Power User Menu. However, you might see PowerShell there instead of Command Prompt depending on how your computer is set up.
Many commands can only be executed if you’re running the Command Prompt as an administrator.
How to Use Command Prompt
To use Command Prompt, you enter a valid Command Prompt command along with any optional parameters. Command Prompt then executes the command as entered and performs the task or function it’s designed to perform in Windows.
For example, executing the following Command Prompt command in your Downloads folder would remove all MP3s from that folder:
Commands must be entered into Command Prompt exactly. The wrong syntax or a misspelling could cause the command to fail or worse; it could execute the wrong command or the right command in the wrong way. A comfort level with reading command syntax is recommended.
For example, executing the dir command will show a list of files and folders that exist at any specific location on the computer, but it doesn’t actually do anything. However, change just a couple letters and it turns into the del command, which is how you delete files from Command Prompt!
Syntax is so important that with some commands, especially the delete command, adding even a single space can mean deleting entirely different data.
Here’s an example where the space in the command breaks the line into two sections, essentially creating two commands where the files in the root folder (files) are deleted instead of the files in the subfolder (music):
The proper way to execute that command so as to remove files from the music folder instead is to remove the space so that the whole command is strung together correctly.
Don’t let this scare you away from using Command Prompt commands, but definitely let it make you cautious.
Command Prompt Commands
A large number of commands exist in Command Prompt, but their availability differs from operating system to operating system. You can view which Command Prompt commands are compatible with a specific operating system here:
Following those command lists will prove that there are lots and lots of commands you can use in Command Prompt, but not all of them are used as often as others.
Here are some of the more commonly used Command Prompt commands that are utilized in a variety of circumstances: chkdsk, copy, ftp, del, format, ping, attrib, net, dir, help, and shutdown.
Command Prompt Availability
Command Prompt is available on every Windows NT-based operating system which includes Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, and Windows 2000, as well as Windows Server 2012, 2008, and 2003.
Windows PowerShell, an advanced command line interpreter available in recent Windows versions, supplements the command executing abilities available in Command Prompt. Windows PowerShell may eventually replace the Command Prompt in a future version of Windows.
Windows Terminal is another Microsoft-approved way of using Command Prompt and PowerShell within the same tool.
27 Useful Windows Command Prompt Tricks You Might Not Know
We talk about Command Prompt in our Windows 10 tutorial posts quite often. Some people unknowingly refer to commands as Command Prompt codes. Speaking of which, there exist tons of Windows Command Prompt tricks that you can learn, use, and impress your friends.
For example, some people may not know how to abort a command or how to watch Star Wars in Command Prompt. Here, we are going to tell you about such interesting Command Prompt tricks.
Windows Command Prompt might look like a black and white world to some users. But the experienced users know the power of Command Prompt and use different cool command hacks and tricks.
So, to make your Windows Command Prompt experience better, in this article, we are going to tell you about some useful Command Prompt tricks that’ll save some extra clicks.
Don’t forget to check out our extensive list of A to Z Windows CMD commands in your free time.
How To Use Command Prompt In Windows 10?
Maybe I don’t need to tell you this. But those who don’t know, you can fire up the command prompt by typing CMD in Windows Search. Right-click on CMD to run it as an administrator.
Alternatively, you can also open Run (Windows + R) > type cmd and press enter. It doesn’t matter whether you’re using Windows 10 or older version, the method is the same.
27 Useful Windows Command Prompt Tricks
1. Command History
Using this command, you can track down your command history. This will turn out to be useful when you are trying to look for some command that you’ve used in the past, but can’t remember.
2. Run multiple commands
If you feel the need to run two commands one after the other, you can do so easily. Add this to your collection of CMD hacks. You just need to put “&&” between each command and save some time. For example, here’s how to run ipconfig and paint.
3. Use Function keys and become a pro user
One out of the very useful CMD tricks is to use function keys. There is a lot these keys can do to improve your CMD experience.
4. See PC driver list
Using a simple command, you can see all the drivers installed on your computer. All you need to do is run the driverquery command, and you’ll be seeing a list of all the drivers along with their name, type, and other information.
5. Send output to clipboard
Very often, you might have felt the need to save the output of a command? Usually, people use copy and paste. However, using a simple command that uses pipe operator, you can send the command’s output to the Windows clipboard. Here’s how to send the ipconfig information:
6. Abort a command
This handy Windows CMD trick comes to rescue when you have pressed the enter key, and you need to stop the command in its tracks? To do it, you need to do a Ctrl+C. However, it isn’t a magic trick that can undo an undoable thing.
7. Make your Command Prompt colorful
You can change the color of the Windows Command Prompt to make it look visually appealing. To do so, right-click in the top corners of the Command Prompt window and select Properties. There, find the Colors tab and look for the options to change the background and text color.
8. Create Wi-Fi hotspot right from the command prompt
Before opening the Command Prompt to execute the commands needed for this, you need to open Control Panel and find Change adapter settings in the Network and Sharing option. There, click on the connection you are using and click on Properties. Now find the sharing tab and check the option “Allow other network users to connect through this computer’s internet connection.”
Now open the Command Prompt with administrative privileges and enter the following command:
After it’s enabled, enter the following command to start the Wi-Fi hotspot
To stop it, simply enter this command:
If you’re using Windows 10?
Windows 10 comes with a built-in tool that lets users create a WiFi hotspot. You can read our detailed post know how to enable mobile hotspot in Windows 10.
9. Scan system files for problems
The sfc /scannow command runs a system file checker tool that scans Windows system files and looks for problems. If some files are missing or corrupted, this command fixes them.
10. Start using batch files
You might already know that batch files can make your life a lot easier when dealing with multiple commands more often. For instance, if you have the habit of using the same CMD commands, you can create a batch file and do away with the task of typing them again and again. All you’ll have to do is run the batch file.
11. Fix issues with DNS resolver cache
You might be knowing that DNS (Domain Name System) is an important thing you can’t ignore when connecting to the internet. To access websites faster, your computer usually maintains a local DNS resolver cache. But sometimes, the cache might get corrupt, and you may not be able to access your favorite sites.
In that case, you can try this Windows command prompt trick to save the day. You can use the Ipconfig utility to remove the DNS cache.
We have already covered many useful Command Prompt tricks and cool hacks in our previous articles. You can read about them and learn how to execute by clicking on the links below:
CMD Alternative: Powershell and Windows Terminal
Over the years, Microsoft has started switching from the good old Command Prompt to its modern successor Powershell. If you might have realized, the places where you could see CMD earlier now show Powershell as the option because it’s the default shell in Windows 10. For example, in the Start button context menu.
You can use it because the commands meant for CMD also work on Powershell.
Furthermore, Microsoft has developed an entirely new command-line experience in the form of a new app called Windows Terminal. It combines the likes of Command Prompt, Powershell, and the Windows Subsystem for Linux. You can read our detailed article on how to set up WSL on your Windows 10 PC.
Unlike CMD and Powershell, Windows Terminal isn’t pre-loaded on Windows 10, and you can get it from Microsoft Store. One thing to note is that Windows Terminal is not available for older Windows versions.
Did you find this article helpful? Tell us in the comments below. Also, if you have some interesting Windows Command Prompt tricks, don’t forget to share them.
Command Prompt: 11 basic commands you should know (cd, dir, mkdir, etc.)
Geeks and experts love the Command Prompt because of the advanced commands it can run. Fortunately, Command Prompt is not built only on advanced commands, but also on simple ones, designed to perform basic operations. In this article, we show you how to execute commands such as changing the current directory, switching to another drive, viewing the contents of a directory, creating and renaming folders, copying, deleting files and folders, and launching applications from the Command Prompt. We are also going to show you how to get help when using this app for Windows. Let’s get started:
NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1, and Windows 7. Note that, for simplicity, we are using screenshots taken only in Windows 10.
1. How to change the directory (folder) in Command Prompt (CMD)
The first command from the list is CD (Change Directory). This command enables you to change the current directory or, in other words, to navigate to another folder from your PC. For instance, the command CD takes you to the top of the directory tree. To see how it works, after you open the Command Prompt, type cd and press Enter on your keyboard. You should see how the CD command takes you to the top of the directory tree. In this case, to the “C:” drive.
Note that the Command Prompt is not case sensitive, meaning that you can type commands using capital letters, lowercase or any combination of them. The commands CD, cd or Cd, all work the same way.
Going back to the “CD” command, now you are working on the root of the “C:” drive. If you need to go to a specific folder from this drive run the command “CD Folder.” The subfolders must be separated by a backslash character: “.” For instance, when you need to access the System32 folder located in “C:\Windows,” type “cd windows\system32” as shown below, and then press Enter on your keyboard.
When you need to go one folder up, use the “cd..” command. Let’s assume that you want to go back to the Windows folder. Type “cd..” and press Enter on your keyboard.
The effect is that your current directory changes to “C:\Windows.”
2. How to change the drive in Command Prompt (CMD)
To access another drive, type the drive’s letter, followed by “:”. For instance, if you wanted to change the drive from “C:” to “D:”, you should type “d:” and then press Enter on your keyboard.
To change the drive and the directory at the same time, use the cd command, followed by the “/d” switch. The “/d” parameter is used to change the current drive to a specific folder from another disk volume.
For instance, if you are now on the “D:” drive and you want to go back to the Windows folder from the”C:” drive, you should type “cd /d C:\Windows” and press Enter on your keyboard, like in the following screenshot.
NOTE: By typing only the drive letter you automatically move to your most recent location on that drive. For instance, if you are on “D:” drive and type “cd c:\windows” nothing seems to happen. However, if you type “c:” then the working folder changes to “c:\windows,” assuming that it was the last folder you worked with on your “C:” drive.
3. How to view the contents of a directory in Command Prompt (CMD)
You can view the contents of a folder by using a command called DIR. To test it, we have created a folder named Digital_Citizen on the D: drive, with several files and subfolders. You can see them in the screenshot below.
The last time, our working folder was “C:\Windows.” To navigate to the folder mentioned above, we have to use the command “cd /d D:\Digital_Citizen.” To view the contents of the folder, type DIR, and press Enter. The list of the files and folders contained by it is displayed, together with some details about each of them (the size and the date and time when they were last modified).
4. How to create a new directory with Command Prompt (CMD)
You can make a new folder using the MKDIR (Make Directory) or the MD command. The syntax of these commands is “MKDIR Folder” or “MD Folder.”
Let’s say we need to create a new folder called Digital_Citizen_Life that is going to be placed in the “D:\Digital_Citizen” folder. To do that, we need to type “mkdir Digital_Citizen_Life” and then press Enter, as shown below.
To test if it worked, use the DIR command again. The newly created folder appears in the list.
NOTE: Do not forget that all these commands depend on the current location in the Command Prompt. For instance, if you are on the “C:” drive and type “MKDIR test,” the new folder is created in the root of the “C:” drive.
Another way to create a folder that does not involve being in the desired folder is to type the complete path of the new folder. For example, if you are working on the “D:” drive and you want to create a new folder in “C:,” called other_stuff, type “mkdir c:\other_stuff” and then press Enter.
When you need to create a folder with subfolders at the same time, you can use the “MKDIR FolderSubfolder” command. For instance, if we type “mkdir Digital_Citizen_Tests\Beta\Test1” three folders are created: Digital_Citizen_Tests, Beta and Test1, in a tree-like structure.
5. How to rename files and folders with Command Prompt (CMD)
To rename files and folders, you need to use the REN (Rename) command. To rename folders, type “ren Folder NewFolderName.” For example, if we wanted to rename the Digital_Citizen_Tests folder to Digital_Citizen_Final_Tests, we should run “ren Digital_Citizen_Tests Digital_Citizen_Final_Tests” and press Enter.
To rename a file, use the same command, like this: “ren filename.extension newname.extension”. For instance, to rename the Digital_Citizen_Picture1.bmp file to Image0.bmp, we have to run the command “ren Digital_Citizen_Image1.bmp Image0.bmp” command.
Read the second page of this tutorial if you want to learn how to copy files and folders, delete files and folders, start an application, and get help when using the Command Prompt.