Command Prompt(CMD) has always been an integral part of windows with its classic black and white interface. CMD works with commands and there are simple and easy commands which can navigate and do repetitive tasks in a more elegant way. With the graphical user interface, fewer people are using command prompt but if you learn these basic commands you can do more with your computer and can impress your peers.
Here you will find the cmd commands with their complete syntax and examples oh how they work.
Table of Contents
Dir command lists all the folder in the current directory. Apart from listing all the folders of directory dir command also shows us a serial number of volume and free space in that folder. Go to command prompt and type
So Dir commands open the directory of the current folder if you want to take the look of a different directory then you have to type Dir command and location of that folder. Now you can see there are 24 folders and 467gb free space.
Tree command is an extension of dir command. Dir command just lists all the folders but tree commands shows us in graphical format.
This command helps to copy folder and files. You just have to type this command then-current location of the file and then the new location of the file. Now I want to copy my Python folder from D drive to F drive so the command is:
xcopy D:\Learning\Python F:\
Del command is for delete purposes. You have to type the command and then locate the folder of that file. Let’s suppose i want to delete the files in F drive so i will type
One thing to remember is for files you also have to mention extension name when I just typed bb1 command prompt could not find the file then I have to mention its extension name which was py and boom it deleted the file.
So now if you want to know the complete information about your computer not just model, ram, but also Hotfixes, Network requirements, or when windows were installed.
If you want to know the name of your computer host or is your computer connected to any network this command is just right for you.
We can use the Echo command to display a message. When making a batch file and we need an alert warning then echo command comes handy for that purpose. For echo command type echo and then type your message.
This command opens the windows explorer or your PC’s graphical user interface. This command is very helpful when My Computer icon gets removed or your mouse is not working.
Time command will simply showtime of your timezone set on your computer. Also, you can edit your computer’s time.
Find command is one of the most helpful commands of command prompt. If you want to search for certain queries in a certain directory this command will help you. For this command to run type find then your search query and finally in which drive you are looking for that search query. Important thing is
find “python” D:\
File compare command is for advance users who wants to compare a file with the option of ASCII comparison. For file compare we type fc command and then add paths of the files of both files.
fc /a D:\dir.png D:\del.png
Next, we have task list command this command works second to task manager. It shows the running tasks which are running right now on your system.
We have seen task list command which shows a list of running task but if we want to end some task then we have task kill command. For this command to run type taskkill then \im and process name.
taskkill \im notepad.exe
Default color scheme of black background and gray in the foreground but if you like different colors and want to change the color scheme then you can do with this color command.
|1 = Blue||9 = Light Blue|
|2 = Green||A = Light Green|
|3 = Aqua||B = Light Aqua|
|4 = Red||C = Light Red|
|5 = Purple||D = Light Purple|
|6 = Yellow||E = Light Yellow|
|7 = White||F = Bright White|
So these are the combinations you can change for the command prompt. Command color 0c will have black ground with red writing.
A shutdown is very important for computers although you can do shutdown with command prompt too. With the command prompt, you can program to shut down your computer with different time intervals.
I hope you will find these commands helpful. If you want to know more about command prompt commands do visit SS64. You will find more syntax and almost every command of cmd there. If you want to learn more about networking commands click here.