Windows Command Line
CSE student | Cybersecurity Learner | Red Team Path | Blogging my CTF & hacking journey .
Faster & More Efficient: You can do things like check your IP with one quick command—no clicking around.
Lower Resource Use: CLI uses less memory, so it works well on old or low-spec computers.
Easy to Automate: You can run scripts to repeat tasks—way easier than clicking through menus.
Great for Remote Work: CLI works well over slow networks and is perfect for managing servers with SSH.
Windows CLI Basics: Useful Commands & Tips
Commands run only if in the system’s PATH.
Check with:set(look forPath=line).
Check Windows version:
UseverView detailed system info:
Usesysteminfo
Too much output? Use
more
Example:driverquery→ Shows all at once
driverquery | more→ View page-by-page (pressSpaceto scroll,Ctrl + Cto exit)
Other Handy Commands:
help→ Get help for any commandcls→ Clear the screen
Network Configuration
Basic network info:
ipconfig
→ Shows IP address, Subnet Mask, Default Gateway
Detailed network info:
ipconfig /all
→ Shows DHCP status, DNS servers, MAC address, and more
Network Troubleshooting
Purpose: Check if your computer can reach another server (e.g., website).
Command:
pingexample.com
How it works: Sends ICMP packets (like ping-pong). If replies come back, the connection is good.
Example result:
4 replies received, average round trip time: 78 ms.tracert– Trace the RouteAnother useful command for troubleshooting is
tracert(short for trace route). It shows the path your data takes to reach a target on the internet, liketracertexample.com.Each stop along the way is a router, and
tracertshows how many routers (or "hops") it passes through. For example, if it shows 15 lines, your packet went through 15 routers to reach the destination.This helps identify where delays or failures happen in the network route.

More Networking Commands
nslookup → Looks up a host or domain and returns its IP address.

nslookup example.com → looks up with the using name server.

netstat→displays current network connections and listening ports

-hdisplays the help page.-adisplays all established connections and listening ports-bshows the program associated with each listening port and established connection-oreveals the process ID (PID) associated with the connection-nuses a numerical form for addresses and port numbersnetstat -abon→ combine of-a,-b,-o,-n.
Working With Directories
cd→display the current drive and directory

cd target_directory→Change to any directory
cd ..→go to parent directory

dir→can view the child directories

dir /a- Displays hidden and system files as well.dir /s- Displays files in the current directory and all sub-directories.
tree -visually represent the child directories and sub-directories.

mkdir →stands for make directory.

rmdir → to delete a directory.

Working With Files
type filename.txt →to display the entire file (good for short files).
Press
Spaceto go to the next page.Press
Enterto move one line.
move→move files.
del or erase→delete any file.
copy→to copy any file.
* →to refer to multiple files. For example, copy *.md C:\Markdown.
Task and Process Management
tasklist→MS Windows Task Manager similar functionality using the command line.

tasklist /FI "imagename eq (task name)"→search for any tasks./FI is used to set the filter image name equals.

taskkill-to kill any processing task.
Conclusion
chkdsk→checks the file system and disk volumes for errors and bad sectors

sfc /scannow→scans system files for corruption and repairs them if possible.
we used the command more in two ways:
Display text files:
more file.txtPipe long output to view it page by page:
some_command | more
shutdown /s→to shutdown your PC
shutdown /r →to restart your PC.
If you found this helpful:
Share it with your fellow learners .
Comment with your favorite CMD command .