Useful Command Prompt (cmd) Commands

ByAnything IT Editor

March 4, 2024
Command PromptCommand prompt (also known as cmd) is a shell to communicate with the system over a text-based interface

Below is a table of useful command prompt command for all actions ranging from system management to viewing information to basically anything you would want to do from the command line, along with a short description of what it does.

CommandDescription
appendAllows programs to open data files in specified directories as if they were in the current directory.
arpDisplays and modifies the IP-to-Physical address translation tables used by ARP.
assocDisplays or modifies file extension associations.
atSchedules commands and programs to run on a computer at a specified time and date.
auditpolDisplays information about and performs functions to manipulate audit policies.
bcdbootCopies boot environment files to the system partition and creates a new system BCD store.
bcdeditEdits boot configuration data.
bitsadminManages the Background Intelligent Transfer Service (BITS).
bootcfgConfigures, queries, or changes Boot.ini file settings.
caclsDisplays or modifies access control lists (ACLs) of files.
changeChanges Terminal Server sessions from Remote Desktop Protocol (RDP) to console mode.
chcpDisplays or sets the active code page number.
choicePrompts the user to select one item from a list of choices.
cipherDisplays or alters the encryption of directories.
clipRedirects output of command line tools to the Windows clipboard.
cmdkeyCreates, displays, and deletes stored user names and passwords.
colorSets the default console foreground and background colors.
compCompares the contents of two files or sets of files.
compactDisplays or alters the compression of files on NTFS partitions.
convertConverts FAT volumes to NTFS.
cscriptInvokes the Windows Script Host for command-line execution of VBScript and JScript files.
dateDisplays or sets the date.
debugStarts Debug, a command-line application used to test and debug other programs.
defragDefragments specified volumes.
diskpartManages disk partitions on a hard drive.
diskuseDisplays the amount of space that is being used on a disk.
doskeyEdits command lines, recalls Windows commands, and creates macros.
driverqueryDisplays a list of all installed device drivers and their properties.
echoDisplays messages or turns command echoing on or off.
editStarts the MS-DOS Editor tool.
enableEnables a device, service, or system feature.
expandExpands one or more compressed files.
fcCompares two files or sets of files and displays the differences between them.
findSearches for a text string in a file or files.
findstrSearches for strings in files.
ftypeDisplays or modifies file types used in file extension associations.
getmacDisplays the media access control (MAC) address for network adapters.
gpresultDisplays Group Policy information for a user or computer.
gpupdateRefreshes local and Active Directory-based Group Policy settings.
graftablEnables the ability to display an extended character set in graphics mode.
helpProvides Help information for Windows commands.
hostnameDisplays the name of the current host.
icaclsDisplays or modifies discretionary access control lists (DACLs) for files and folders.
ipconfigDisplays TCP/IP network configuration information.
labelCreates, changes, or deletes the volume label of a disk.
logoffTerminates a session.
lpqDisplays the status of a print queue on a computer running Line Printer Daemon (LPD).
lprSends a file to a computer running Line Printer Daemon (LPD) for printing.
makecabCreates a cabinet (.cab) file.
modeConfigures system devices.
moreDisplays output one screen at a time.
mountvolCreates, deletes, or lists a volume mount point.
moveMoves files or directories.
nbtstatDisplays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).
netshDisplays or modifies the network configuration of a computer.
nslookupDisplays information that you can use to diagnose Domain Name System (DNS) infrastructure.
nulAccepts input written to its standard input handle, ignores that input, and produces no output.
openfilesDisplays files opened by remote users for a file share.
pathDisplays or sets a search path for executable files.
pathpingCombines the functionality of the Ping tool with that of the Tracert tool.
pauseSuspends processing of a batch program and displays a message.
pingSends Internet Control Message Protocol (ICMP) Echo Request messages to a destination computer.
pnputilAdds, deletes, or lists the driver packages in the driver store.
popdRestores the previous value of the current directory saved by pushd.
printPrints a text file.
promptChanges the Windows CMD shell prompt.
pushdSaves the current directory then changes it.
qgrepSearches input file(s) for lines that match a given pattern.
qprocessDisplays information about processes.
rdRemoves a directory.
recimgConfigures a custom recovery image.
recoverRecovers readable information from a bad or defective disk.
regPerforms operations on registry subkeys and entries.
regeditStarts Registry Editor.
reginiProcesses the Reg.ini file.
regsvr32Registers or unregisters a DLL.
remRecords comments (remarks) in batch files or CONFIG.SYS.
renameRenames a file or files.
replaceReplaces files.
resetClears the screen and removes all messages.
restoreRestores a file from backup media.
robocopyAdvanced utility to copy files and directories.
routeManipulates network routing tables.
runasAllows a user to run specific tools and programs with different permissions.
scCommunicates with the Service Controller and installed services.
schtasksSchedules commands and programs to run on a computer.
sdbinstInstalls a database for an application that uses the Windows Installer.
setDisplays, sets, or removes CMD environment variables.
setlocalBegins localization of environment changes in a batch file.
sfcScans and verifies the integrity of all protected system files and replaces incorrect versions with correct versions.
shadowStarts the Remote Desktop Services shadowing for another user on the Remote Desktop Session Host (RD Session Host) server.
shutdownShuts down or restarts a local or remote computer.
sortSorts input.
startStarts a separate CMD window to run a specified program or command.
substAssociates a path with a drive letter.
systeminfoDisplays detailed configuration information about a computer.
takeownAllows an administrator to take ownership of a file.
taskkillEnds one or more tasks or processes.
tasklistDisplays a list of currently running tasks and services.
timeDisplays or sets the system time.
timeoutPauses CMD processing for a specified time.
titleSets the CMD window title.
traceprtPrints Windows Installer information for a Windows Installer package file.
treeGraphically displays the directory structure of a drive or path.
typeDisplays the contents of a text file.
verDisplays the Windows version.
verifyTells Windows whether to verify that your files are written correctly to a disk.
volDisplays a disk volume label and serial number.
w32tmConfigures Windows Time service settings.
waitforSends or waits for a signal on a system.
wbadminPerforms backup and recovery operations.
wevtutilRetrieves information about event logs and publishers from files on local and remote computers.
whereDisplays the location of files that match the search pattern.
whoamiDisplays the current domain and user name.
winrsWindows Remote Shell.
wmicProvides a command-line interface for Windows Management Instrumentation (WMI).
xcopyCopies files and directory trees.