IT FundamentalsA+

Windows Command Line Tools for CompTIA A+ 220-1102

The Windows command line is a critical tool for A+ technicians. CompTIA A+ 220-1102 tests knowledge of CMD and PowerShell commands for file management, networking, disk repair, and system administration. This guide covers every command-line tool listed in the A+ objectives with real-world usage examples.

13
7 sections · 8 exam key points
2 practice questions

CMD Fundamentals

Command Prompt (cmd.exe) is the legacy Windows command-line interpreter. Run as administrator for commands that require elevated privileges: right-click Start → Command Prompt (Admin), or search cmd → right-click → Run as administrator. Key navigation commands: `cd` (change directory), `cd ..` (go up one level), `dir` (list directory contents), `mkdir` or `md` (create directory), `rmdir` or `rd` (remove directory — use /s to remove non-empty), `cls` (clear screen), `exit` (close). Wildcards: `*` matches any characters, `?` matches one character. `dir *.txt` lists all .txt files. Tab completion works in CMD (press Tab to complete file/folder names).

File Management Commands

copy: copies files. `copy source.txt destination.txt`. xcopy: copies files and directory trees. `xcopy C:\source D:\dest /s /e /h` (/s=subdirectories, /e=empty folders, /h=hidden files). robocopy: robust file copy, network-aware, supports retry and mirroring. `robocopy C:\source D:\dest /mir` (mirror). move: moves files. `move file.txt C:\newlocation`. del: deletes files. `del /f /q file.txt` (/f=force, /q=quiet). ren or rename: renames files. `ren oldname.txt newname.txt`. type: displays file contents (like cat in Linux). `type file.txt`. attrib: view or set file attributes. `attrib +h file.txt` (hidden), `attrib +r` (read-only), `attrib +s` (system), `attrib -h` (remove hidden).

Disk and File System Commands

chkdsk: Check Disk — scans and repairs file system errors. `chkdsk C: /f` (fix errors — must schedule for C: when in use). `chkdsk C: /r` (locate bad sectors and recover readable info — implies /f). diskpart: disk partitioning utility. Interactive: type `diskpart`, then `list disk`, `select disk 0`, `list partition`, `select partition 1`, `format fs=ntfs quick`, `assign letter=E`. format: formats volumes. `format E: /fs:ntfs /q` (quick format). sfc (System File Checker): scans and repairs protected Windows system files. `sfc /scannow` (requires admin). DISM (Deployment Image Servicing and Management): repairs Windows image. `DISM /Online /Cleanup-Image /RestoreHealth`. Run DISM before SFC if SFC fails.

Network Commands

ipconfig: displays IP configuration. `ipconfig` (basic), `ipconfig /all` (detailed, including MAC address, DHCP server, DNS servers). `ipconfig /release` (release DHCP lease), `ipconfig /renew` (get new IP from DHCP), `ipconfig /flushdns` (clear DNS resolver cache). ping: tests connectivity. `ping 8.8.8.8`, `ping -t google.com` (continuous). tracert: traces the route packets take. `tracert google.com`. nslookup: DNS query tool. `nslookup google.com`, `nslookup google.com 8.8.8.8` (query specific DNS server). netstat: shows active connections. `netstat -a` (all), `netstat -n` (numeric), `netstat -b` (show process for each connection — requires admin). net: manages network resources. `net use`, `net share`, `net user`, `net localgroup`. pathping: combines ping and tracert, shows packet loss per hop.

Process and System Commands

tasklist: lists running processes. `tasklist`, `tasklist /fi "imagename eq notepad.exe"` (filter). taskkill: terminates processes. `taskkill /im notepad.exe /f` (force kill by name), `taskkill /pid 1234 /f` (by PID). shutdown: shuts down or restarts. `shutdown /s /t 0` (immediate shutdown), `shutdown /r /t 0` (restart), `shutdown /a` (abort scheduled shutdown), `shutdown /l` (logoff). sc: Service Control — manages Windows services. `sc query`, `sc start servicename`, `sc stop servicename`, `sc config servicename start=auto`. systeminfo: displays system configuration summary (OS version, RAM, patches, boot time). hostname: displays the computer name. ver: displays Windows version. msconfig (System Configuration): run from CMD, manages startup items and boot options. gpupdate /force: applies Group Policy updates.

PowerShell Essentials

PowerShell is the modern replacement for CMD, using object-based cmdlets. Run as admin via: right-click PowerShell → Run as Administrator. Common cmdlets: Get-Command (list all commands), Get-Help <cmdlet> (help), Set-ExecutionPolicy RemoteSigned (allows local scripts to run). File system: Get-ChildItem (like dir), Copy-Item, Move-Item, Remove-Item, New-Item. Process management: Get-Process, Stop-Process -Name notepad. Service management: Get-Service, Start-Service, Stop-Service, Set-Service. Network: Test-NetConnection (like ping with more info), Get-NetIPConfiguration (like ipconfig). PowerShell scripts use .ps1 extension. Execution policy controls whether scripts run: Restricted (default, no scripts), RemoteSigned (local scripts OK, remote must be signed), Unrestricted (all scripts run with warning).

Recovery and Boot Commands

bootrec: repairs Windows boot records. Run from Windows Recovery Environment (WinRE): `bootrec /fixmbr` (repair MBR), `bootrec /fixboot` (repair boot sector), `bootrec /rebuildbcd` (rebuild Boot Configuration Data — use when Windows doesn't appear in boot menu). bcdedit: Boot Configuration Data editor. View boot entries: `bcdedit /enum`. Add safe mode entry: complex, usually done via System Configuration. regedit: Registry Editor — opens the Windows registry GUI. Run from CMD: `regedit`. reg: command-line registry tool. `reg query HKLM\Software\Microsoft\Windows\CurrentVersion`. winver: displays Windows version in a GUI dialog. mstsc: launches Remote Desktop Connection client.

Key exam facts — A+

  • chkdsk /f fixes errors; chkdsk /r also finds bad sectors (implies /f)
  • sfc /scannow repairs Windows system files — run as admin
  • DISM /Online /Cleanup-Image /RestoreHealth — repairs Windows image, run before SFC if SFC fails
  • ipconfig /flushdns — clears DNS cache; /release and /renew for DHCP
  • bootrec /fixmbr, /fixboot, /rebuildbcd — used in WinRE to fix boot issues
  • taskkill /f /im process.exe — force kill a process by name
  • xcopy /s copies subdirectories; robocopy /mir mirrors source to destination
  • PowerShell execution policy: RemoteSigned allows local scripts; Restricted blocks all

Common exam traps

Practice questions — Windows Command Line

These questions are representative of what you will see on A+ exams. The correct answer and explanation are shown immediately below each question.

Q1.

A.A. chkdsk /r
B.B. DISM /Online /Cleanup-Image /RestoreHealth
C.C. sfc /scannow
D.D. bootrec /fixboot

Explanation: DISM repairs the Windows image store. If the image is corrupted, SFC cannot pull replacement files. Run DISM first, then SFC /scannow to repair individual system files.

Q2.

A.A. /flushdns
B.B. /renew
C.C. /release
D.D. /all

Explanation: /release sends a DHCP release message and removes the current IP assignment. /renew requests a new IP address from the DHCP server.

Frequently asked questions — Windows Command Line

When should I use PowerShell instead of CMD?

Use PowerShell for automation scripts, managing Active Directory, querying system information, and any task that benefits from object-based output (you can pipe objects, not just text). Use CMD for quick commands and when working with legacy batch scripts (.bat files). In practice, PowerShell is the modern standard and can do everything CMD can do plus much more.

Practice this topic

Test yourself on Windows Command Line

JT Exams routes you to questions in your exact weak areas — automatically, after every session.

No credit card · Cancel anytime

Related certification topics