Learn necessary commands in windows command prompt

Almost all windows users have heard the name of Command Prompt. We all use windows GUI(Graphical User Interface) to perform all of our tasks easily. But if we want to realize what happens in the background we must learn Command Prompt.

cmd whoami

Command Prompt is also helpful for performing some very useful works which are not possible with normal GUI, such as deleting viruses, showing your ip and full system configuration, booting windows in safe mood, making visible any hidden file or folders which are suspicious and take action against them. Command Prompt is undoubtedly a must for all programmers. So, in this article I am going to show you some very common and basic commands in windows command prompt.

Common Commands in Windows Command Prompt:

Intoduce Yourself with Command Prompt:

Press Windows+R and write cmd in it and press Enter.

command prompt
Now a window will open which is known as cmd. Write whoami and press enter you will see your pc username as the first picture in this article.

View System Info: 

To see detailed system info of your PC write systeminfo in CMD and press enter.

cmd systeminfo

Open a Directory and View all Files:

Open CMD and write a drive name with colon(:). As an example F: and press enter. then write dir and you will see all files and folders remaining in the root of this drive. You can now go to any other folder or directory on the drive. As an example in my F: drive I have a folder named techweb24 and if I want to go inside the folder I have to write cd techweb24 . (here cd means change directory)

cmd directory

Open File with Command Prompt:

Go to a directory and view files and folders with dir command. Then if you want to open a file write filename and press enter. It's for file name with single word. If the file or folder name contains more than one word then you need to enclose the file name with a doble quotation(""), which will be like as "new file". As as example if you want to open a file named bangle rap.mp4, I have to write "bangle rap.mp4 and press enter to open this video file".

open file with cmd

Delete File with Command Prompt: 

Go to a directory and view files and folders with dir command. Then if you want to delete a file or folder write del foldername or del filename. It's for file or folder name with single word. If the file or folder name contains more than one word then you need to enclose the file or folder name with a doble quotation(""), which will be like as del "new folder". As as example if you want to delete a file named bangle rap.mp4, I have to write del "bangle rap.mp4 to delete this file".

delete file with cmd

There an another way to delete file easily with address. It's less time consuming. Open CMD and write del "file address". As an Example if I want to delete a file named as new file.txt which is situated in F: drive, I need to write del "F:\new file.txt"




del file by adress with cmd

Remove a Directory with CMD:

Write rd /s directory name or rd /s "directory name" (here rd means remove directory).
Example: rd /s techweb24 or rd /s "new folder"

remove or delte directory with cmd

Task kill with CMD: 

Write tasklist in CMD, it will show full Task List.

view tasklist with cmd

Now if you want to kill a task or software(known as image), write taskkill /im taskname .Example: taskkill /im notepad.exe


kill a task with cmd

 Make hidden files and folders visible with CMD: 

It's a very important command for deleting viruses without clicking on them. Open CMD go to the directory or pendrive where you want see hidden files files visible,
then write this command attrib -s -r -h *.* /s /d /l and press enter. Now go to your directory you will see all hidden files and you can use or delete them.

make hidden files visible with cmd

Now you have learned basic and very useful commands of windows command prompt. There are many other commands in CMD like mkdir for making new directory (mkdir directoryname), ipconfig for viewing ip address, move, rename etc. Now I hope you will be able to use this command by yourself as you have already learned all basics about windows command prompt. If you have any problem please inform me. I will try my best to give solution.
Do not forget to subscribe us!
Previous
Next Post »

2 comments

Write comments