CompTIA A+ Study GuideCompTIA A+ 220-1101/1102

A+ Command-Line Tools: ipconfig, sfc, chkdsk and diskpart

The A+ exam tests command-line tool selection. Here is what each key command does, what its most important flags are, and how the exam uses it in scenarios.

10 min read
11 sections
Courseiva Study Hub

Quick answer

The A+ exam tests command-line tool selection. Here is what each key command does, what its most important flags are, and how the exam uses it in scenarios.

Command-line tool questions on the A+ exam present a scenario and ask which command accomplishes a specific task, or they show command output and ask what it means. Knowing the purpose and key flags for each tool is what separates right answers from wrong ones.

ipconfig

ipconfig displays and manages Windows IP configuration.

Command What It Does
ipconfig Shows IP address, subnet mask, default gateway for all adapters
ipconfig /all Full detail: MAC address, DHCP server, DNS servers, lease times
ipconfig /release Releases the current DHCP lease (IP address returned to server)
ipconfig /renew Requests a new DHCP lease
ipconfig /flushdns Clears the local DNS resolver cache
ipconfig /displaydns Shows the current DNS cache contents

Exam scenarios:

"A workstation has a 169.254.x.x address and cannot reach the network." — Run ipconfig /release then ipconfig /renew. The 169.254 range is an APIPA address indicating the DHCP server could not be reached.

"A user reports a website is loading an old version. Other users see the correct version." — Run ipconfig /flushdns to clear the cached DNS entry.

"Which command shows the MAC address of the network adapter?" — ipconfig /all.

sfc (System File Checker)

sfc /scannow — Scans all protected Windows system files and replaces corrupted or modified files from a cached copy.

  • Must be run from an elevated (administrator) command prompt
  • Takes several minutes to complete
  • Results are logged to C:\Windows\Logs\CBS\CBS.log

For offline repair (system cannot boot): sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows

When to use: after malware removal, after a failed update, or when Windows is exhibiting unexplained instability.

chkdsk (Check Disk)

chkdsk scans the file system and disk surface for errors.

Flag Effect
None Scan only (read-only, no fixes)
/f Fix file system errors
/r Locate bad sectors and recover readable data (includes /f)
/x Force dismount of the volume before scan (for non-boot drives)

For the system drive (C:), chkdsk /f cannot run while Windows is using the drive — it schedules a scan for the next boot.

Exam tip: /f fixes logical errors. /r also scans the physical disk surface for bad sectors. If the question involves a hard drive with suspected bad sectors, use chkdsk /r.

diskpart

diskpart is a command-line disk management tool for creating, deleting, and formatting partitions.

Common diskpart commands:

diskpart
list disk
select disk 1
list partition
select partition 1
format fs=ntfs quick
assign letter=D

When to use: when the GUI Disk Management tool is not available (WinRE), when creating or modifying partitions during OS installation, or when troubleshooting disk visibility issues.

Exam tip: diskpart is the correct tool when a question says "from the command line, how would you format a partition?" — not format alone (which does not assign drive letters or handle partitions).

netstat

netstat displays active network connections, listening ports, and routing tables.

Flag Effect
-a All connections and listening ports
-n Show numeric IP addresses (no DNS resolution)
-o Show the owning process ID (PID) for each connection
-b Show the executable involved in each connection

Security use: netstat -ano shows all connections with process IDs. You can cross-reference PIDs with Task Manager to identify which process is making unexpected network connections — useful for detecting malware phoning home.

tracert and ping

ping tests basic connectivity and round-trip time. tracert (trace route) shows every hop between your machine and the destination, with the round-trip time to each hop.

Exam scenario: "A user can ping the gateway but cannot reach external websites. Which command would show where connectivity fails?" — tracert — it shows exactly at which router the packets stop.

"Which command tests whether a remote host is reachable?" — ping.

Practice A+ command-line questions with output-reading scenarios to build speed on tool selection and interpretation.

Windows-Specific Troubleshooting Commands

These appear on the A+ exam but get less coverage in basic study materials. Know what each does and when to use it.

tasklist: Displays all currently running processes with their PID, memory usage, and session. Useful for identifying unknown processes that may indicate malware.

${F} tasklist tasklist /fi "imagename eq notepad.exe" ${F}

The /fi flag filters by criteria. If you want to check whether a specific process is running, filter by name rather than scrolling through the full list.

taskkill: Terminates a process by name or PID.

${F} taskkill /im notepad.exe taskkill /F /PID 1234 ${F}

/F forces termination (equivalent to End Task in Task Manager). /PID specifies by process ID. The combination taskkill /F /PID 1234 is the reliable way to kill a process that is not responding to a normal close request. In malware scenarios, if a malicious process respawns when killed by name, kill it by PID immediately after identifying it in tasklist.

gpupdate /force: Applies Group Policy changes immediately without waiting for the next automatic refresh interval. After making a Group Policy change on a domain controller, run this on affected workstations to apply immediately. The /force flag reapplies all policy settings even if they haven't changed, not just the delta.

gpresult /r: Displays the Resultant Set of Policy — which Group Policy Objects are applied to the current computer and user. Run this when troubleshooting why a GPO setting is or is not in effect. The output shows which GPOs were applied, which were filtered out, and the WMI filter status.

${F} gpresult /r gpresult /scope computer /r (computer settings only) gpresult /scope user /r (user settings only) ${F}

net user: Manages local user accounts from the command line.

${F} net user username (display account info) net user username /active:no (disable account) net user username newpassword (change password) net user newuser password /add (create account) ${F}

net localgroup: Manages local groups.

${F} net localgroup Administrators (list members) net localgroup Administrators username /add net localgroup Administrators username /delete ${F}

bootrec vs bcdedit — When to Use Each

Both tools deal with Windows boot configuration. The A+ exam expects you to know which situation calls for which command.

bootrec: Automatically repairs common boot problems. You do not need to know the current BCD configuration — bootrec scans, detects problems, and fixes them.

  • bootrec /fixmbr — Writes a new Master Boot Record to the boot disk. Does not overwrite the existing partition table. Use when the MBR is corrupted or infected.
  • bootrec /fixboot — Writes a new boot sector to the active partition. Use when the boot sector is corrupted.
  • bootrec /rebuildbcd — Scans all disks for Windows installations and adds them to a new BCD store. Use when the BCD is missing or corrupted.
  • bootrec /scanos — Scans all disks for Windows installations and displays them without making changes. The difference from /rebuildbcd: /scanos just shows you what's there; /rebuildbcd actually rebuilds the store. Use /scanos first to confirm Windows installations are detected before using /rebuildbcd.

bcdedit: A manual editing tool for the Boot Configuration Data. Displays the current BCD contents and allows making precise changes to individual entries.

${F} bcdedit (display all BCD entries) bcdedit /set {current} safeboot minimal (configure Safe Boot) bcdedit /deletevalue {current} safeboot (remove Safe Boot config) bcdedit /enum all (show all boot entries) ${F}

When to use each: bootrec when the system is not booting and you need automated repair. bcdedit when the system boots but you need to modify boot behavior (add a boot entry, change timeout, enable/disable Safe Boot programmatically).

PowerShell vs cmd — When Each Is Required

The A+ 220-1102 exam increasingly includes PowerShell questions because modern Windows administration relies on it.

When cmd is required:

  • Running bootrec, bcdedit, sfc from WinRE (Recovery Environment — PowerShell is not available in all WinRE configurations)
  • Running batch scripts (.bat, .cmd files)
  • Some legacy tools that do not have PowerShell equivalents or that behave differently in PowerShell

When PowerShell is required:

  • Managing Windows features (Get-WindowsFeature, Install-WindowsFeature)
  • Remote management (Enter-PSSession, Invoke-Command)
  • The exam-tested basic cmdlets:

${F}powershell Get-Process # Lists running processes (equivalent of tasklist) Stop-Process -Name notepad Stop-Process -Id 1234

Get-Service # Lists services and their status Start-Service -Name "Print Spooler" Stop-Service -Name "Print Spooler"

netsh wlan show profiles # Shows saved Wi-Fi profiles (works in both) netsh wlan export profile # Exports Wi-Fi profile including key ${F}

The exam pattern: "A technician needs to view all running processes on a Windows 11 computer from the command line using a modern approach." Answer: Get-Process in PowerShell. "A technician needs to repair a corrupt boot sector from the Recovery Environment." Answer: bootrec /fixboot in cmd.

Output Reading — Annotated ipconfig /all

The exam can give you ipconfig /all output and ask questions about what it means. Here is how to read each field for troubleshooting.

${F} Windows IP Configuration

Host Name . . . . . . . . . . . . : WORKSTATION01 Primary Dns Suffix . . . . . . . : corp.company.com Node Type . . . . . . . . . . . . : Hybrid

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : corp.company.com Description . . . . . . . . . . . : Intel(R) Ethernet Connection Physical Address. . . . . . . . . : 00-1A-2B-3C-4D-5E DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 10.10.5.42(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Monday, May 18, 2026 8:14 AM Lease Expires . . . . . . . . . . : Tuesday, May 19, 2026 8:14 AM Default Gateway . . . . . . . . . : 10.10.5.1 DHCP Server . . . . . . . . . . . : 10.10.5.100 DNS Servers . . . . . . . . . . . : 10.10.1.10 10.10.1.11 NetBIOS over Tcpip. . . . . . . . : Enabled ${F}

Physical Address (MAC): Identifies the network adapter hardware. If the question asks "which command shows the MAC address," the answer is ipconfig /all.

DHCP Enabled: Yes + Lease information: Confirms this is a DHCP-assigned address, who issued it (DHCP Server field), and how long it is valid. Lease Expires tells you when the IP could change. If Lease Expires is in the past, the IP was not renewed — check DHCP connectivity.

IPv4 Address marked "(Preferred)": The IP is valid and preferred by the system. If you see "(Duplicate)" instead, another device on the subnet has the same IP — IP conflict.

169.254.x.x with DHCP Enabled: The DHCP server was unreachable. APIPA address assigned automatically. Next step: ipconfig /release then ipconfig /renew, then diagnose why the DHCP server is not responding.

Default Gateway missing or 0.0.0.0: The workstation has an IP but no route to other networks. Common cause: incorrect DHCP scope configuration, or static IP configured without a gateway.

DNS Servers: If these are wrong, name resolution will fail. Symptom: can ping by IP but not by hostname. Correct DNS servers are typically the internal DNS server IPs for domain-joined machines, not the ISP's DNS.

Practice Question Sets

Session Questions Estimated time Link
Quick check 10 10–12 min Start →
Standard session 20 20–25 min Start →
Focused drill 30 30–40 min Start →
Deep study block 50 50–65 min Start →
Full mock exam 120 2–2.5 hours Start →

Practise A+ questions

Original exam-style practice questions with detailed, explained answers. Track your weak topics and review missed questions before exam day.

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.