Windows Command Line Commands You Need for CompTIA A+

If you’re preparing for the CompTIA A+ Core 2 (220-1202) exam, Windows command line commands are one of those topics you simply cannot afford to skip. These commands appear across multiple domains — Operating Systems, Security, and Software Troubleshooting — and they frequently show up in performance-based questions (PBQs) where you’re expected to demonstrate real-world diagnostic skills, not just recall definitions. The exam gives you up to 90 questions and 90 minutes to prove yourself, so knowing exactly which command does what — and when to use it — can be the difference between a passing score of 700/900 and going home empty-handed. Let’s break this down command by command.

Why the Command Line Matters on the CompTIA A+ Exam

Modern Windows operating systems come with graphical interfaces, but IT technicians rely on the command line every day for speed, precision, and tasks that the GUI simply can’t handle. CompTIA knows this, which is why the 220-1202 exam tests your ability to use the command prompt in realistic troubleshooting scenarios. Expect questions that describe a symptom — say, a PC that can’t reach the internet — and ask which command you’d run first to diagnose it.

The commands covered below are drawn directly from CompTIA’s official exam objectives. Understand what each one does, what output it produces, and why a technician would reach for it in a given situation.

Essential Windows Commands for CompTIA A+

ipconfig — Your First Stop for Network Troubleshooting

ipconfig displays the current IP configuration of your network adapters, including the IP address, subnet mask, and default gateway. Run ipconfig /all to see extended details like the MAC address, DNS servers, and DHCP lease information.

  • ipconfig — Shows basic IP info for all adapters
  • ipconfig /all — Full details including MAC address and DHCP server
  • ipconfig /release — Releases the current DHCP-assigned IP address
  • ipconfig /renew — Requests a new IP address from the DHCP server (port 67/68)
  • ipconfig /flushdns — Clears the DNS resolver cache (port 53)

The exam expects you to know that if a user’s machine shows an IP address starting with 169.254.x.x, it means DHCP failed and the machine assigned itself an APIPA address. Your next step? ipconfig /release followed by ipconfig /renew.

ping — Testing Connectivity Step by Step

ping sends ICMP echo requests to a target address to test whether it’s reachable. Technicians use ping in a specific order during troubleshooting: first ping the loopback address (127.0.0.1) to verify TCP/IP is functioning locally, then ping the default gateway, and finally ping an external address like 8.8.8.8 to test internet connectivity.

If pinging by IP works but pinging by hostname fails, you have a DNS resolution problem — not a connectivity problem. That distinction matters on exam day.

tracert — Tracing the Path of Network Traffic

tracert (trace route) shows each hop a packet takes to reach its destination. When a user can reach some websites but not others, or latency is unusually high, tracert helps identify exactly where in the network the traffic is breaking down. Each line in the output shows a router along the path and the round-trip time to reach it.

netstat — Monitoring Active Connections

netstat displays active network connections, listening ports, and protocol statistics. This is a key security command — if you suspect malware is phoning home, netstat -an shows all active connections and which ports they’re using. Knowing your port numbers here is critical: suspicious traffic on port 3389 (RDP), 445 (SMB), or unexpected outbound connections on port 23 (Telnet) are red flags a technician needs to recognize.

nslookup — Diagnosing DNS Problems

nslookup queries DNS to resolve hostnames to IP addresses. If a user can browse by IP but not by name, nslookup confirms whether the DNS server (port 53) is responding correctly. Type nslookup google.com and you’ll see the resolved IP address and which DNS server answered the query.

sfc and DISM — Repairing Corrupted System Files

When Windows is behaving strangely — random crashes, missing DLL errors, applications that won’t launch — corrupted system files are often the culprit. sfc /scannow (System File Checker) scans protected Windows files and replaces corrupted ones from a local cache. If sfc can’t fix the issue, DISM /Online /Cleanup-Image /RestoreHealth goes further by pulling replacement files from Windows Update. In a troubleshooting scenario, run sfc first, then DISM if sfc reports it couldn’t repair everything.

chkdsk — Checking Drive Health

chkdsk checks the file system and disk surface for errors. Running chkdsk /f fixes file system errors, while chkdsk /r locates bad sectors and attempts to recover readable data. If a user reports slow performance, frequent freezes, or file corruption — especially on an older HDD — chkdsk is a logical first diagnostic step.

diskpart — Advanced Disk Management

diskpart is a powerful command-line tool for managing disks, partitions, and volumes. Technicians use it when GUI tools like Disk Management can’t complete a task — for example, cleaning a disk that shows as write-protected, or setting up partitions during a Windows installation. Use it with care: diskpart commands are irreversible.

gpupdate and gpresult — Group Policy Tools

In a Windows domain environment, Group Policy controls security settings across all machines. gpupdate /force immediately applies the latest Group Policy settings to a workstation without waiting for the next automatic refresh cycle. gpresult /r shows which policies are currently applied to a user or computer — useful for troubleshooting why a setting isn’t taking effect.

Test Your Knowledge

Question 1: A technician is troubleshooting a workstation that has no internet connectivity. Which command should they run first to check the machine’s current IP address, subnet mask, and default gateway?

  1. ping
  2. ipconfig
  3. netstat
  4. tracert

Answer: B — ipconfig. Before doing anything else, a technician needs to know the machine’s current IP configuration. If the IP starts with 169.254.x.x, DHCP has failed. If the default gateway is missing, routing is broken. ipconfig gives you the starting information you need to diagnose the problem systematically.

Question 2: Windows is running slowly and applications are frequently crashing. A technician suspects the operating system may be using disk space to supplement physical RAM. What Windows feature is responsible for this behavior?

  1. The temporary internet files cache
  2. The pagefile, which extends RAM using drive space as virtual memory
  3. The Master Boot Record partition table
  4. System Restore points

Answer: B — The pagefile. When physical RAM is fully utilized, Windows uses a portion of the hard drive or SSD as virtual memory via the pagefile (pagefile.sys). This is normal behavior, but if the system relies on it heavily, performance degrades significantly — especially on machines with slow HDDs. The solution is typically to add more RAM.

Want more practice? Certcy has 110+ questions like these — download free.

Study Tips for Mastering Command Line Commands

  • Practice in a real terminal. Open Command Prompt on a Windows machine and run each command. Seeing actual output cements the knowledge better than reading alone.
  • Learn the flags, not just the commands. The exam often distinguishes between ipconfig and ipconfig /flushdns — know your switches.
  • Associate commands with scenarios. Instead of memorizing a list, ask yourself: “When would I actually use this?” Scenario-based thinking maps directly to how PBQs are written.
  • Group commands by category. Network commands (ipconfig, ping, tracert, netstat, nslookup), disk commands (chkdsk, diskpart), and system repair commands (sfc, DISM) each have their own troubleshooting context.
  • Test yourself regularly. Passive reading won’t prepare you for PBQs. Use Certcy’s free CompTIA A+ practice questions to drill these scenarios under realistic conditions.

Frequently Asked Questions

Which exam covers Windows command line commands — Core 1 or Core 2?

Command line tools are primarily tested on the Core 2 (220-1202) exam, particularly within the Operating Systems (22%) and Software Troubleshooting (22%) domains. However, network-related commands like ping and ipconfig can appear in networking troubleshooting scenarios on both exams. Focus your command line prep on Core 2, but don’t ignore it entirely when studying Core 1.

How many command line questions can I expect on the 220-1202 exam?

CompTIA doesn’t publish a breakdown by subtopic, but command line tools are explicitly listed in the 220-1202 exam objectives and frequently appear in performance-based questions (PBQs), which typically show up at the start of the exam. You could realistically encounter 5-10 questions or PBQ scenarios that require command line knowledge. Given that the passing score is 700/900, every point matters — don’t treat this topic as optional.

What’s the difference between sfc and DISM?

sfc /scannow (System File Checker) uses a local cached copy of Windows system files to repair corruption. If that local cache itself is corrupted, sfc won’t be able to fix everything. That’s where DISM (Deployment Image Servicing and Management) comes in — it can download replacement files directly from Windows Update to repair both the component store and system files. The exam-level answer: run sfc first, then DISM if sfc fails or reports it couldn’t repair files.

Do I need to memorize the exact syntax for every command?

For the CompTIA A+ exam, you don’t need to know every obscure flag — but you absolutely need to know the most common switches for key commands. Specifically: ipconfig /all, ipconfig /flushdns, ipconfig /release and /renew, chkdsk /f and /r, sfc /scannow, and gpupdate /force. The exam will test whether you know the right tool and the right switch for a given scenario, not whether you’ve memorized an entire man page.

Ready to stop reading and start practicing? Certcy is a free mobile app built specifically for CompTIA A+, ISC2 CC, and ISC2 SSCP exam prep. With 110+ expert-written A+ questions, gamified study sessions, AI-personalized study plans, and offline mode so you can study anywhere, Certcy makes sure you’re ready for the real thing — not just familiar with the material. Download Certcy free today and start turning command line knowledge into exam-day confidence.

Get Free Study Tips in Your Inbox

Weekly exam strategies, domain breakdowns, and Certcy updates. No spam, unsubscribe anytime.

Ready to Pass Your Certification?

Practice with 1,890 expert-written questions across 17 CompTIA, ISC2, AWS, and Cisco exams.
Free to start, no credit card required.


Download Certcy Free

Scroll to Top