💻

Guide to Windows Command-Line Tools

Jun 2, 2025

Windows Commands

Overview

  • Windows has built-in Win32 console commands.
  • Documentation covers Windows Commands for task automation through scripts or scripting tools.

Command-Line Shells

  • Command Shell
    • First shell in Windows.
    • Automates tasks with batch (.bat) files.
    • Supports sophisticated scripts using Windows Script Host.
  • PowerShell
    • Designed to extend Command Shell capabilities.
    • Runs PowerShell commands (cmdlets) and Windows Commands.
    • PowerShell cmdlets offer a more extensible scripting language.
    • Recommended for modern Windows automation.

Error Codes and Redirection

PowerShell Core

  • Open-source version of PowerShell.
  • Can be downloaded and installed separately.

File and Directory Name Completion

  • Auto-completion configured by default with the tab key.
  • Configurable via registry keys:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\PathCompletionChar
  • Caution advised when editing registry.
  • Per instance enable/disable via cmd.exe with /F:ON or /F:OFF.
  • Overrides: user settings > computer settings > command-line options > registry settings.

Command Lookup

  • Commands are organized alphabetically.
  • Specific command information is accessible via linked sections.

Examples of Commands

  • A: active, add, add alias, add volume, adprep, append, arp, assign, assoc, at, atmadm, attach-vdisk, attrib, attributes.
  • B: bcdboot, bcdedit, bdehdcfg, begin backup, bitsadmin
  • C: cacls, call, cd, certreq, certutil, change, chcp, chdir, cls, cmd, cmdkey, comp, compact, convert, copy
  • D: date, dcdiag, defrag, del, delete, detail, dir, diskcomp, diskcopy, diskpart
  • E: echo, edit, endlocal, erase, eventcreate
  • F: fc, find, findstr, finger, format, fsutil, ftp
  • G: getmac, goto, gpresult
  • H: help, hostname
  • I: icacls, if, import, ipconfig
  • J: jetpack
  • K: klist, ksetup, ktmutil, ktpass
  • L: label, lodctr, logman
  • M: manage bde, mapadmin, md, mkdir
  • N: nbtstat, netcfg, netdom, netsh, netstat, nslookup
  • O: offline, online, openfiles
  • P: path, pathping, pause, ping, powershell
  • Q: qprocess, query, quser
  • R: rd, recover, reg, ren, replace, reset
  • S: sc config, schtasks, secedit, select, set, shutdown
  • T: taskkill, telnet, time, tracert, tree, tskill
  • U: unexpose, uniqueid
  • V: ver, vol, vssadmin
  • W: wbadmin, wdsutil, wecutil, wevtutil, where, whoami
  • X: xcopy

Registry Warning

  • Incorrect registry modifications can severely damage the system.
  • Backup data before making changes.