Jump to content

10 useful Windows command line prompts

From WikiInfo

Good examples, you know you can use

logoff 

to logoff your PC? Or

Shutdown/s 

to shutdown your PC? And there's shutdown

/r /fw 

to boot into your BIOS?

Tasklist

Tasklist

At any time, you can kill a task with the additional command taskkill /PID PID # here /F.

My list starts with Tasklist. This is one of the more simple commands you can use in Command Prompts. All it does is function as a text-based version of the Task Manager. It lists every simple running task on your laptop or desktop. The first column gives you the image name (the name of the task), the second one a process ID, the third, a type of session, and the last, the memory usage. To use it, simply type in:


Chkdsk

Next up is Chkdsk. You'll need administrator privileges for this command, but I use this command for checking disks for errors. If you feel your PC is running slow or giving you issues, you can use this command to check the disk for file system errors. This was more useful back when HDDs were more common as a primary drive in computers and laptops. Chkdsk will fix issues with the master file table (MFT), bad security descriptors associated with files, or misaligned time stamp or file size information about individual files. You can copy the command below:

Chkdsk

Sfc /scannow

Sfc /scannow

My third most used command is Sfc /scannow. This is the system file-checking tool. What this command will do is simply check the integrity of your operating system by checking protected system files. If your PC isn't working properly, this is one of the first you should try. This command is used when a user might have modified critical system files.


Diskpart

diskpart

Next up is Diskpart. Once you enter Diskpart, you can use List disk you can see every single disk on your PC, and peek at how much storage is used or continue on with disk operations Think of this as a text-based version of the storage page in the Windows 11 settings app. After the intial Diskpaet command, I type out list disk to see a list of all the connected drives to my system. Another useful command is select disk (followed by the disk number) then clean to clean up an attached HDD or SSD to reformat it when the graphical user interface.


Ver

Ver

Need to know the version of Windows you're running? Ver is a simple command that will list of the operating system version for you. It's useful if you're the technical type of person that likes to stay on top of build numbers and Windows releases.


Systeminfo

systeminfo

Related to Ver is Systeminfo. With this command, you can see everything about your system. You'll see the physical memory, the virtual memory, network cards, Hyper-V status, the manufacturer of your computer, the processor, or even when Windows was first installed. Again, it's great for technical folks who value sharing this information.


Ipconfig

Ipconfig

Need to know your IP address? Ipconfig is the home for networking tasks on Windows. It lists out networks you might be connected to, subnets, gateways, and other critical networking information. I often use this to grab information about my network adapters, and my router.


Ping

ping google.com

Somewhat related to ipconfig is ping. This is one of the more useful command line prompts should you want to check the connectivity between two hosts. It also will check for lost packets, too. I use it to check for internet connectivity, and the status of websites, but you can ping any computer on any server to test a connection to them by using their IP address.


Assoc

Assoc

Need to check which file type is associated with what extension? That's what assoc is for. You'll see a readout of every single file extension that's being used on your PC. You also can type out the file extension of the end to see what file it's associated with. In the example below, typing assoc.doc reads out the fact that this is a Microsoft Word document. Or assoc.html read out that this is an HTML file. Pretty basic, but pretty useful, too.


Help

Help

Not sure how to use Command Prompt? That's what help is for. Once you open the app and type this command, you'll get a list of the most common commands that you can use on your PC. Many of the ones we've mentioned are already there. It's a great spot for beginners.