Windows Command Line

  • 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 for Path= line).

  • Check Windows version:
    Use ver

  • View detailed system info:
    Use systeminfo

  • Too much output? Use more
    Example:

    • driverquery → Shows all at once

    • driverquery | more → View page-by-page (press Space to scroll, Ctrl + C to exit)

  • Other Handy Commands:

    • help → Get help for any command

    • cls → 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:
    ping example.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 Route

    Another useful command for troubleshooting is tracert (short for trace route). It shows the path your data takes to reach a target on the internet, like tracert example.com.

    Each stop along the way is a router, and tracert shows 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

  • -h displays the help page.

  • -a displays all established connections and listening ports

  • -b shows the program associated with each listening port and established connection

  • -o reveals the process ID (PID) associated with the connection

  • -n uses a numerical form for addresses and port numbers

  • netstat -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 Space to go to the next page.

  • Press Enter to 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.txt

  • Pipe 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 .

0
Subscribe to my newsletter

Read articles from MD MUNIF MUBTASHIM directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

MD MUNIF MUBTASHIM
MD MUNIF MUBTASHIM

CSE student | Cybersecurity Learner | Red Team Path | Blogging my CTF & hacking journey .