⚡ Why the Command Line Matters
The Windows command line is tested heavily on A+ Core 2 — not just "what does ipconfig do" but which specific switch solves the problem in the scenario. A user can't connect after moving to a new office (ipconfig /release and /renew). A user's profile is corrupted (sfc /scannow). You need to find what's running on port 443 (netstat -an). Knowing the command is step one — knowing the right switch is what the exam actually tests.
Networking Commands
Displays and manages IP configuration for all network adapters. The most-used network troubleshooting command — always run this first. Shows IP address, subnet mask, default gateway, and DNS servers. If you see 169.254.x.x, DHCP has failed (APIPA).
ipconfig
ipconfig /all
ipconfig /release
ipconfig /renew
ipconfig /flushdns
ipconfig /displaydns
Exam scenarios: "User can't get online after moving to a new network — run /release then /renew." "User reaches wrong website despite URL being correct — run /flushdns to clear stale cached DNS entry." "169.254 address seen — DHCP failed, run /release /renew or check DHCP server."
Tests basic Layer 3 (IP) connectivity using ICMP echo requests. A ping response proves the network path to that host works. No response could mean the host is down, ICMP is blocked by a firewall, or the route doesn't exist. Ping the loopback first to confirm TCP/IP is installed.
ping 127.0.0.1
ping 192.168.1.1
ping 8.8.8.8
ping google.com
ping -t 8.8.8.8
ping -n 10 8.8.8.8
Exam troubleshooting ladder: ping 127.0.0.1 (TCP/IP stack OK) → ping own IP (NIC OK) → ping default gateway (local network OK) → ping 8.8.8.8 (internet routing OK) → ping google.com (DNS OK). Failure at each step identifies the layer of the problem.
Shows the hop-by-hop path packets take to a destination and the round-trip time for each hop. Uses ICMP with incrementing TTL values. Each hop is a router. High latency at a specific hop indicates congestion or routing problems at or near that router. * * * means that router is not responding to ICMP — not necessarily a failure.
tracert 8.8.8.8
tracert -d 8.8.8.8
Exam scenarios: "A user has internet access but a specific website is slow — tracert identifies which hop is adding latency." "tracert fails at hop 3 — the router at that hop is unreachable or blocking ICMP." Linux/macOS equivalent: traceroute.
Queries DNS servers to resolve names to IPs or look up specific DNS records. Indispensable for diagnosing DNS problems. Can query specific DNS servers (not just the default) and request specific record types (MX, CNAME, TXT etc.).
nslookup google.com
nslookup 8.8.8.8
nslookup google.com 1.1.1.1
nslookup -type=MX gmail.com
nslookup -type=TXT example.com
Exam scenarios: "A user can ping IPs but not hostnames — run nslookup to confirm DNS resolution is failing." "Email delivery is failing — run nslookup -type=MX to check MX records." "Check if DNS cache poisoning is occurring — query a trusted external DNS server to compare results."
Displays active network connections, listening ports, and associated processes. Critical for identifying what's using which port, detecting unexpected outbound connections (potential malware C2 traffic), and confirming services are listening.
netstat -a
netstat -n
netstat -an
netstat -b
netstat -ano
netstat -e
netstat -r
Exam scenarios: "Identify which process is using port 8080 — run netstat -ano then find the PID in tasklist." "Suspected malware — run netstat -an to look for unexpected ESTABLISHED connections to external IPs."
System Maintenance Commands
Scans and repairs corrupted or missing Windows system files. Compares protected system files against a cached copy stored in the WinSxS folder. Repairs any files that don't match. Must be run as Administrator. On Windows 10/11, run DISM first if sfc reports it cannot fix files.
sfc /scannow
sfc /verifyonly
DISM /Online /Cleanup-Image /RestoreHealth
Exam scenarios: "A user reports random application crashes and missing DLL errors — run sfc /scannow to repair corrupted system files." "sfc /scannow reports it could not repair some files — run DISM /RestoreHealth first, then re-run sfc."
Scans a disk for file system errors and bad sectors. Without switches, chkdsk runs read-only and reports errors but doesn't fix them. With /f it fixes file system errors; with /r it locates bad sectors and attempts to recover data. On the system drive, chkdsk /f schedules the check to run at next boot (cannot check a drive that's in use).
chkdsk C:
chkdsk C: /f
chkdsk C: /r
chkdsk D: /f /r
Exam scenarios: "A user reports files becoming corrupted and Windows showing disk errors — run chkdsk /r to check for bad sectors." "/f vs /r: /f fixes file system logical errors; /r does everything /f does plus physical bad sector scan."
tasklist shows all running processes and their PIDs. taskkill terminates a process by PID or name. Used together to identify and kill unresponsive or suspicious processes from the command line (Task Manager alternative, useful in scripts or when the GUI is unresponsive).
tasklist
tasklist | find "notepad"
taskkill /PID 1234
taskkill /IM notepad.exe
taskkill /PID 1234 /F
Exam scenarios: "From netstat -ano you found PID 4820 has an unexpected external connection — use tasklist to identify the process, then taskkill /PID 4820 /F to terminate it."
Shuts down, restarts, or logs off local or remote systems from the command line. Useful for remote administration and scripted maintenance.
shutdown /s /t 0
shutdown /r /t 0
shutdown /s /m \\PCNAME /t 60
shutdown /a
Exam note: /s = shutdown, /r = restart, /t = time delay in seconds, /m = remote machine. Remote shutdown requires admin rights on the target machine.
User and Account Management Commands
Creates, modifies, and manages local user accounts from the command line. Also displays account details. Requires Administrator privileges for modifications.
net user
net user jsmith
net user jsmith /add
net user jsmith NewPass1!
net user jsmith /active:no
net user jsmith /delete
net localgroup administrators jsmith /add
Exam scenarios: "An employee is on leave — disable their account: net user jsmith /active:no." "New temp worker needs a local account — net user tempuser Pass1! /add."
gpupdate forces an immediate Group Policy refresh — instead of waiting for the background refresh interval (90 minutes ± 30 for computers, 90 minutes for users). gpresult shows which policies are actually applied to the current user and computer.
gpupdate
gpupdate /force
gpresult /r
gpresult /h gp-report.html
Exam scenarios: "A new GPO was deployed but users aren't seeing the change — run gpupdate /force on affected machines." "Verify which GPOs are applying to a user — run gpresult /r."
File and Disk Commands
Powerful command-line tool for managing disks, partitions, and volumes. Used when the GUI Disk Management tool won't work — particularly for pre-OS environments (Windows PE/recovery). Dangerous — changes are immediate and irreversible.
diskpart
list disk
select disk 1
list partition
clean
Exam scenarios: "Preparing a new drive for Windows installation — use diskpart to create and format partitions." "A drive shows as RAW — diskpart can reformat (after data backup)."
robocopy (Robust File Copy) is the modern standard for copying files and folder trees with reliability features — retries on failure, preserves permissions and timestamps, mirrors directories, and can run as a sync job. xcopy is the older alternative, still tested on A+.
robocopy C:\Source D:\Dest /E
robocopy C:\Source D:\Dest /MIR
xcopy C:\Source D:\Dest /E /H /Y
Exam note: robocopy is preferred over xcopy for A+ Core 2 — it's more reliable, handles long paths, and has better error handling. /MIR is used for backup sync jobs.
Command Quick Reference
| Command | Primary Use | Key Switch |
| ipconfig /all | Show full IP config inc. MAC, DHCP server | /release + /renew = fix DHCP. /flushdns = clear DNS cache |
| ping | Test Layer 3 connectivity hop by hop | -t = continuous. -n 10 = 10 packets |
| tracert | Show path and latency to destination | -d = skip DNS lookups (faster) |
| nslookup | Query DNS records | -type=MX, -type=TXT for specific records |
| netstat -ano | Show active connections with PID | -b = show process name (admin only) |
| sfc /scannow | Repair corrupted system files | Run as admin. Run DISM first if it fails. |
| chkdsk /r | Check disk for errors + bad sectors | /f = fix errors only. /r = fix + bad sectors |
| tasklist | List running processes | Pipe to find "name" to filter |
| taskkill /F | Force-kill process by PID or name | /PID = by ID. /IM = by name |
| net user | Manage local user accounts | /add, /delete, /active:no |
| gpupdate /force | Force Group Policy refresh | /force re-applies all policies |
| gpresult /r | Show applied Group Policy objects | /h file.html = full report |
| shutdown /r /t 0 | Immediate restart | /s = shutdown. /m \\PC = remote |
| diskpart | Disk and partition management | Interactive — list disk, select, clean |
| robocopy /MIR | Mirror copy / backup sync | /E = include empty subdirs |
Opening the command prompt correctly
Standard CMD: Win+R → cmd → Enter. Limited privileges — cannot run commands that require admin.
Elevated CMD (Run as Administrator): Search "cmd" → right-click → "Run as administrator." Required for sfc, chkdsk /f, net user changes, and most system commands. Many A+ exam scenarios specifically note that admin privileges are needed.
PowerShell vs CMD: PowerShell is the modern shell and can run all CMD commands plus its own cmdlets. The A+ Core 2 exam tests CMD commands specifically — know both exist but focus on CMD syntax for the exam.
Exam Scenarios
💬 "A user moved to a new building and cannot get an IP address. Their adapter shows 169.254.x.x. Which commands should the technician run?" → ipconfig /release followed by ipconfig /renew — releases the failed APIPA address and requests a new DHCP lease on the new network.
💬 "A user can ping 8.8.8.8 but cannot reach google.com by name. Which command diagnoses the DNS problem?" → nslookup google.com — confirms DNS resolution is failing. Also run ipconfig /flushdns to clear any stale cached entries.
💬 "A technician suspects a process is making unexpected connections to an external IP. Which commands identify the process?" → netstat -ano to see the connection and its PID, then tasklist | find "PID" to identify the process name.
💬 "A user reports application crashes and missing DLL errors after a Windows update. Which command should be run first?" → sfc /scannow (as Administrator) — scans and repairs corrupted Windows system files. If it fails, run DISM /RestoreHealth first.
💬 "A drive is showing file system errors after an improper shutdown. Which command with which switches fixes this?" → chkdsk C: /f — /f fixes file system errors. Add /r if you also want to check for bad sectors (slower but more thorough).
💬 "An IT admin deployed a new Group Policy restricting USB drives, but users are still able to use USB drives. What should the admin run on the affected machines?" → gpupdate /force — forces immediate re-application of all Group Policy objects without waiting for the background refresh interval.
💬 "Which command shows the route packets take across the internet and identifies where latency is being introduced?" → tracert — traces the hop-by-hop path and shows round-trip time for each router, identifying where delays occur.
Related Articles