💻

Essential Windows Command Prompt Commands

Aug 10, 2024

Top 40 Windows Command Prompt Commands

Launching Command Prompt

  • Use Windows Key + S or search for cmd in the start menu.
  • Run as Administrator for full access.

Basic Networking Commands

Find IP Address

  • Command: ipconfig
    • Displays basic IP information.

Detailed Network Configuration

  • Command: ipconfig /all
    • Displays all network configuration details including:
      • MAC address
      • DNS server

Filtering Output

  • Use pipe to filter output:
    • Command: ipconfig /all | findstr DNS
    • Replace DNS with other keywords as needed.

Renewing IP Address

  • Command: ipconfig /release then ipconfig /renew
    • Releases and requests a new IP from DHCP.
    • To specify an interface, add it after the command.

Troubleshooting DNS

  • View DNS cache:
    • Command: ipconfig /displaydns
    • Copy output to clipboard: ipconfig /displaydns | clip

Flush DNS Cache

  • Command: ipconfig /flushdns
    • Deletes DNS resolver cache.

DNS Lookup

  • Command: nslookup [domain]
    • Find the IP address of a domain.
    • To use a different DNS server, specify it after the domain.

Screen Management

  • Clear screen:
    • Command: cls

Mac Address and Power Management

  • Get MAC address:

    • Command: getmac /v
  • Power efficiency report:

    • Command: powercfg /energy
  • Battery report:

    • Command: powercfg /battery report

File Associations

  • View file type associations:
    • Command: assoc
    • Change association: assoc .mp4=<program>

Disk Check and System Scans

Check Disk

  • Command: chkdsk
    • Check disk for errors.
    • Use /f to fix errors, /r to check for bad sectors.

System File Checker

  • Command: sfc /scannow
    • Checks and repairs system files.

Deployment Image Servicing and Management

  • Command: DISM
    • Check health: DISM /Online /CheckHealth
    • Restore health: DISM /Online /RestoreHealth

Task Management

Listing Tasks

  • Command: tasklist
  • Kill a task:
    • Command: taskkill /F /PID [PID]

Advanced Networking Commands

Netsh Commands

  • Command: netsh wlan show report
    • Wireless report.
  • Manage Windows Firewall:
    • Command: netsh advfirewall set allprofiles state off
    • Turn back on: netsh advfirewall set allprofiles state on

Ping and Traceroute

  • Ping a website:
    • Command: ping [website]
    • Continuous ping: ping -t [website]
  • Traceroute command:
    • Command: tracert [website]
    • Faster trace without resolving domain names: tracert -d [website]

Networking Statistics

  • Command: netstat -a
    • View open connections and listening ports.
  • Show statistics:
    • Command: netstat -e -t 5

Routing

  • View routing table:
    • Command: route print
  • Add a route:
    • Command: route add [destination] mask [subnet mask] [gateway]
  • Delete a route:
    • Command: route delete [destination]

System Shutdown and BIOS Access

  • Shutdown command:
    • Command: shutdown
    • Reboot into BIOS:
      • Use specific switches for advanced shutdown options.

Additional Notes

  • Keep your antivirus updated (e.g., Bit Defender).
  • Regularly check system health to avoid major issues.