Useful Windows 10 Commands

Sometimes the best tool for the job is the command line, even on Windows. But we have to know how to use it. Here are some of the best command line tools for various tasks.

ipconfig

ipconfig can be used to quickly find out our IP address, and also for other purposes.

  • ipconfig – show network connections and their properties
    • /all – show detailed information
    • /release – releases the connection
    • /renew – renew the connection
    • /flushdns – flush DNS resolver cache

ping

ping can be used to check connectivity to other destinations. For example, if we enter command “ping google.com”, Windows will send packets to Google.com server which will respond and let is know it’s received them.

tracert

tracert traces the route for a packet to reach a destination. For example, “tracert google.com” command will show us the path a packet takes to reach Google.

shutdown

  • shutdown /s /t 0 – shut down the computer immediately
  • shutdown /r /t 0 – restart the computer immediately

scf

  • sfc /scannow – find and fix corrupted system files

telnet

telnet command can be used to connect to telnet servers. The telnet client isn’t installed by default. You’ll have to install it from the Control Panel.

cipher

  • cipher /W:pathname –  clear free space  ensuring no deleted file can be recovered

powercfg

  • powercfg /energy – analyze system’s power usage for 60 seconds and generate a detailed report to System32 folder

netstat

  • netstat -an – display a list of all open network connections on a computer, along with the used port and the foreign IP address connected to

assoc

assoc can be used to display a full list of file extensions and the programs they’re connected with.

driverquery

driverquery can be used to show a list of drivers on our system.

fc

File compare (fc) can be used to identify differences in text between two files. “/b” compares only binary output, “/c” disregards the case of text in the comparison, and “/l” only compares ASCII text. For example:

fc "C:\example1.txt" "C:\example2.txt"

tasklist

tasklist command can be used to provide a list of all tasks running on a PC.

taskkill

  • taskkill -pid {process-id} – stop a program using its ID

tree

Execute tree from any directory to see the folder structure under that directory.

net use

The net use command can be used to assign shared drives on a network to as a drive letter on local computer.

nslookup

  • nslookup www.saadz26.sg-host.com –  find out the IP address of a saadz26.sg-host.com website.