command prompts

List of Windows Command Prompt (CMD) Commands in 2025

Joseph Richard
By
Joseph Richard
Founder & Tech Expert
Joseph is the founder of Mawese.com, where he shares in-depth analysis of the latest tech and business trends in Kenya. As a web developer and tech...
- Founder & Tech Expert
24 Min Read

The Command Prompt may look like a relic of the computing past, but it remains one of Windows’ most powerful tools. It is usually hidden behind a simple text interface, but behind it lies a control center that can perform tasks impossible through the graphical interface alone. If you are a Windows user, it is no surprise that you might have or do interact with the Windows Command Prompt daily through a set of commands to save time, solve problems, or even unlock capabilities that aren’t accessible any other way.

In this day and age where everything is digital, Knowing the right command prompt to use is important for various widows, be it IT professionals, developers, or even everyday users. There are between 1,500 to 3,000+ commands, depending on your system setup, installed tools, and Windows version, available for your own use, and this guide covers all that you need to know and master for everyday use.

Essential CMD Commands Every Windows User Should Know

Below is a complete list of Command Prompt commands, often called CMD commands, for all Windows versions

Most Commonly Used Commands

CommandDescriptionSyntaxExampleNotes/Tips
cdChanges the current directorycd followed by the pathcd C:\Users\DocumentsUse cd .. to move up one directory level. Use cd \ to go to drive root.
dirLists files and directoriesdir followed by options and pathdir /a /s *.txt/a shows hidden files, /s includes subdirectories.
copyCopies filescopy followed by source and destinationcopy report.txt backup\Use /y to suppress confirmation prompts.
delDeletes filesdel followed by filenamedel old_report.txtUse with caution; deleted files do not go to the Recycle Bin.
mkdir or mdCreates a new directorymkdir followed by directory namemkdir projectsCan create multiple nested directories with /s.
rmdir or rdRemoves a directoryrmdir followed by directory namermdir old_projectsUse /s to delete directory and all its content.
typeDisplays contents of a text filetype followed by filenametype readme.txtUseful for quick viewing without opening an editor.
echoDisplays messages or toggles command echoingecho followed by messageecho Hello WorldCan redirect output to files using echo text > file.txt.
clsClears the screenclsclsUseful for decluttering the command prompt window.
findSearches for text strings in filesfind followed by string and filenamefind “error” log.txtUse /i for case-insensitive search.
ipconfigDisplays network configurationipconfig with or without optionsipconfig /all/all shows detailed network configuration.
pingTests network connectivityping followed by hostping google.comUse -t for continuous ping until stopped manually.
netstatDisplays network statisticsnetstat followed by optionsnetstat -an-a shows all connections, -n shows numerical addresses.
tasklistLists running processestasklist with or without optionstasklist /fi “username eq administrator”/fi allows filtering by various criteria.
taskkillTerminates processestaskkill using process ID or nametaskkill /im notepad.exeUse /f to force termination.
systeminfoDisplays system informationsysteminfosysteminfoProvides comprehensive details about the system.
sfcRuns System File Checkersfc followed by /scannowsfc /scannowScans and repairs Windows system files.
chkdskChecks disk for errorschkdsk followed by drive and parameterschkdsk C: /f/f fixes errors, may require restart when checking system drives.
shutdownShuts down or restarts the computershutdown followed by optionsshutdown /r /t 60/r restarts, /t sets time delay in seconds before action.
helpDisplays help information for commandshelp followed by command namehelp dirShows detailed syntax and options for the specified command.

Complete Command Reference

Commands A-C

CommandPrimary FunctionFull SyntaxExample UsageWindows Version Compatibility
assocView or modify file extension associationsassoc [.ext[=[fileType]]]assoc .txt=txtfileWindows XP and later
atSchedule commands and programs (deprecated)at [\computername] time [/interactive] [/every:date] [/next:date] “command”at 14:30 “backup.bat”Windows XP to Windows 8 (replaced by schtasks)
attribDisplay or change file attributesattrib [+r-r] [+a-a] [+s
bcdbootConfigure boot filesbcdboot source [/l locale] [/s volume-letter] [/v] [/m [{OS-loader-GUID}]] [/addlast/p]bcdboot C:\Windows /s D:
bcdeditManage boot configuration databcdedit [/store filename] command [options]bcdedit /set {default} bootmenupolicy legacyWindows Vista and later
breakSet or clear extended CTRL+C checkingbreak [onoff]break on
caclsDisplay or modify file access control lists (deprecated)cacls filename [/t] [/e] [/c] [/g user:perm] [/r user […]] [/p user:perm […]] [/d user […]]cacls file.txt /g User:FWindows XP (replaced by icacls)
callCall one batch program from anothercall [drive:][path]filename [batch-parameters]call subroutine.bat param1All Windows versions
cd or chdirChange directorycd [/d] [drive:][path]cd /d D:\ProjectsAll Windows versions
chcpChange active code pagechcp [nnn]chcp 1252All Windows versions
chkdskCheck disk for errorschkdsk [volume[[path]filename]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:size]] [/b]chkdsk C: /f /rAll Windows versions
chkntfsDisplay or modify automatic disk checkingchkntfs volume […] [/d] [/t[:time]] [/x volume […]] [/c volume […]]chkntfs C: /xWindows XP and later
choicePrompt user to select from choiceschoice [/c choices] [/n] [/cs] [/t timeout /d choice] [/m text]choice /c YN /m “Continue?”Windows XP and later
cipherDisplay or alter file encryptioncipher [/e/d/c] [/s:dir] [/b] [/h] [/k] [/f] [/u[/n]] [/w:dir] [/a] [/i] [/m] [pathname […]]
clipCopy command output to clipboardcommandclipdirclipAll Windows versions
clsClear the screenclsclsAll Windows versions
cmdStart a new command promptcmd [/a/u] [/q] [/d] [/e:on/e:off] [/f:on
colorChange console foreground and background colorscolor [attr]color 0AWindows XP and later
compCompare the contents of two filescomp [data1] [data2] [/d] [/a] [/l] [/n=number] [/c]comp file1.txt file2.txtAll Windows versions
compactDisplay or change file compressioncompact [/c/u] [/s[:dir]] [/a] [/i] [/f] [/q] [filename […]]compact /c /s:C:\Documents
convertConvert FAT to NTFSconvert volume /fs:ntfs [/v] [/cvtarea:filename] [/nosecurity] [/x]convert D: /fs:ntfsAll Windows versions
copyCopy filescopy [/d] [/v] [/n] [/y/-y] [/z] [/l] [/a/b] source [/a

Commands D-I

CommandPrimary FunctionFull SyntaxExample UsageWindows Version Compatibility
dateDisplay or set datedate [/t | date]date 12-25-2023All Windows versions
defragDefragment diskdefrag volume [/a] [/f] [/v] [/r] [/x] [/b] [/w] [/d]defrag C: /vAll Windows versions
del or eraseDelete filesdel [/p] [/f] [/s] [/q] [/a[[:]attributes]] namesdel /s *.tmpAll Windows versions
dirList files and directoriesdir [drive:][path][filename] [/a[[:]attributes]] [/b] [/c] [/d] [/l] [/n] [/o[[:]sortorder]] [/p] [/q] [/s] [/t[[:]timefield]] [/w] [/x] [/4]dir /a /s *.docAll Windows versions
diskcompCompare contents of two floppy disksdiskcomp [drive1: [drive2:]]diskcomp A: B:All Windows versions
diskcopyCopy contents of one floppy disk to anotherdiskcopy [drive1: [drive2:]] [/v]diskcopy A: B: /vAll Windows versions
diskpartDisk partitioning tooldiskpartdiskpartWindows XP and later
doskeyEdit command line, recall commands, create macrosdoskey [/reinstall] [/listsize=size] [/macros[:all | :exename]] [/history] [/insert | /overstrike] [/exename=exename] [/macrofile=filename] [macroname=[text]]doskey /historyAll Windows versions
driverqueryDisplay installed device driversdriverquery [/s system [/u username [/p [password]]]] [/fo {table | list | csv}] [/nh] [/v]driverquery /fo csv /vWindows XP and later
echoDisplay messages or toggle command echoingecho [on | off | message]echo Processing files…All Windows versions
endlocalEnd localization of environment changesendlocalendlocalAll Windows versions
eraseDelete files (same as del)erase [/p] [/f] [/s] [/q] [/a[[:]attributes]] nameserase /p confidential.txtAll Windows versions
eventcreateCreate custom event in event logeventcreate [/s computer [/u domain\user [/p password]]] /id eventid [/l {APPLICATION|SYSTEM}] [/so srcname] [/t {ERROR|WARNING|INFORMATION|SUCCESSAUDIT|FAILUREAUDIT}] /d descriptioneventcreate /id 1000 /t ERROR /d “Backup failed”Windows XP and later
exitExit the command prompt or scriptexit [/b] [exitCode]exit /b 1All Windows versions
expandExtract files from compressed filesexpand [-r] source destinationexpand -r archive.cab C:\files\All Windows versions
fcCompare filesfc [/a | /b] [/c] [/l] [/lb n] [/n] [/off[line]] [/t] [/u] [/w] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2fc /b file1.exe file2.exeAll Windows versions
findSearch for text string in filesfind [/v] [/c] [/n] [/i] [/off[line]] “string” [[drive:][path]filename[…]]find /i “error” log.txtAll Windows versions
findstrSearch for patterns in filesfindstr [/b] [/e] [/l] [/r] [/s] [/i] [/x] [/v] [/n] [/m] [/o] [/p] [/f:file] [/c:string] [/g:file] [/d:dirlist] [/a:colorattribute] [/off[line]] strings [[drive:][path]filename[…]]findstr /i /s “warning” *.logWindows XP and later
fingerDisplay information about remote userfinger [user]@hostfinger jdoe@serverWindows XP (limited support)
forLoop through a set of itemsfor [/d] [/r [path]] [/l [initial] [step] [end]] [/f [“options”] [“string”] [/c cmd] [/v var]] {%%parameter | %parameter} in (set) do commandfor %i in (*.txt) do echo %iAll Windows versions
forfilesProcess files in batchforfiles [/p pathname] [/m searchmask] [/s] [/c command] [/d [+ | -] date]forfiles /p C:\ /s /m *.txt /d -30 /c “cmd /c del @path”Windows Vista and later
formatFormat disk for Windowsformat volume [/fs:filesystem] [/v:label] [/q] [/a:size] [/c] [/x] [/p:passes] [/s:source]format F: /fs:ntfs /qAll Windows versions
fsutilFile system utilityfsutil [command] [options]fsutil fsinfo volumeinfo C:Windows XP and later
ftpFile Transfer Protocol clientftp [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [host]ftp -s:commands.txt ftp.example.comAll Windows versions
ftypeDisplay or modify file type associationsftype [fileType[=[openCommandString]]]ftype txtfile=”notepad.exe %1″Windows XP and later
getmacDisplay MAC address of network adaptersgetmac [/s computer [/u domain\user [/p password]]] [/fo {TABLE | LIST | CSV}] [/nh] [/v]getmac /vWindows XP and later
gotoJump to labeled line in batch filegoto labelgoto error_handlerAll Windows versions
gpresultDisplay Group Policy settingsgpresult [/s computer [/u domain\user [/p [password]]]] [/user targetusername] [/scope {user | computer}] [/r | /v | /z] [/x | /h filename ]gpresult /rWindows XP and later
helpDisplay help informationhelp [command]help dirAll Windows versions
hostnameDisplay computer namehostnamehostnameAll Windows versions
icaclsDisplay or modify file access control listsicacls name [/grant[:r] sid:perm] [/deny sid:perm […]] [/remove[:g|:d]] sid[…]] [/t] [/c] [/l] [/q] [/setintegritylevel level]icacls file.txt /grant Users:RWindows Vista and later
ifPerform conditional processingif [not] errorlevel number command or if [not] string1==string2 command or if [not] exist filename commandif exist file.txt echo File existsAll Windows versions
ipconfigDisplay IP configurationipconfig [/all | /renew [adapter] | /release [adapter] | /flushdns | /displaydns | /registerdns | /showclassid adapter | /setclassid adapter [classid]]ipconfig /allAll Windows versions

Commands J-P

CommandPrimary FunctionFull SyntaxExample UsageWindows Version Compatibility
labelCreate, change, or delete volume labellabel [drive:][label]label C:SYSTEMAll Windows versions
logmanManage performance logslogman [create|query|start|stop|delete|update|import|export] [options]logman create counter log1 -c “\Processor(_Total)% Processor Time”Windows XP and later
logoffLog off userlogoff [sessionname|sessionid] [/server:servername] [/v]logoffWindows XP and later
makecabCreate cabinet (.cab) filesmakecab [source] [destination] [/v[n]] [/d var=value …] [/l dir]makecab file.txt archive.cabWindows XP and later
md or mkdirCreate directorymd [drive:]pathmd C:\Projects\NewAll Windows versions
mklinkCreate symbolic linksmklink [[/d] | [/h] | [/j]] Link Targetmklink /d LinkDir TargetDirWindows Vista and later
modeConfigure system devicesmode com[m] [baud=b] [parity=p] [data=d] [stop=s] [to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off] [dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off] or mode con[:] [cols=c] [lines=n]mode con: cols=80 lines=25All Windows versions
moreDisplay output one screen at a timemore [/e] [/c] [/p] [/s] [/tn] [+n] [files]dir /s moreAll Windows versions
mountvolCreate, delete, or list volume mount pointsmountvol [drive:path | drive: | path] [volumename | /d | /l | /p | /r | /n | /e]mountvol D: \?\Volume{GUID}\Windows XP and later
moveMove filesmove [/y | /-y] [drive:][path]filename1[,…] destinationmove *.txt C:\Archive\All Windows versions
msinfo32Display system informationmsinfo32 [/categories {+n
msiexecWindows Installer toolmsiexec /option [parameters]msiexec /i program.msiWindows XP and later
nbtstatDisplay NetBIOS over TCP/IP statisticsnbtstat [-a RemoteName] [-A IP address] [-c] [-n] [-r] [-R] [-RR] [-s] [-S] [interval]nbtstat -a ComputerNameAll Windows versions
netNetwork command groupnet [accounts | computer | config | continue | file | group | help | helpmsg | localgroup | name | pause | print | send | session | share | start | statistics | stop | time | use | user | view]net userAll Windows versions
netshNetwork shellnetsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName]UserName] [-p Password | *] [Command | -f ScriptFile]netsh interface show interfaceWindows XP and later
netstatDisplay network statisticsnetstat [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-x] [-t] [interval]netstat -anoAll Windows versions
nslookupQuery DNS serversnslookup [-subcommand] [computerToFind | [-server]]nslookup google.comAll Windows versions
openfilesDisplay or disconnect files opened remotelyopenfiles /query [/s system [/u username [/p [password]]]] [/fo {TABLE | LIST | CSV}] [/nh] [/v] [/disconnect [/a id] [/se sessions] [/op openfile]]openfiles /queryWindows XP and later
pathDisplay or set command search pathpath [[drive:]path[;…][;%path%]]path %path%;C:\ScriptsAll Windows versions
pathpingTrace route plus network latencypathping [-g host-list] [-h maximum_hops] [-i address] [-n] [-p period] [-q num_queries] [-w timeout] [-4] [-6] target_namepathping -n google.comWindows XP and later
pausePause batch file executionpausepauseAll Windows versions
perfmonPerformance Monitorperfmon [/res | /report | /sys | /rel]perfmon /resWindows XP and later
pingTest network connectivityping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] [-R] [-S srcaddr] [-c compartment] [-p] [-4] [-6] target_nameping -n 5 google.comAll Windows versions
popdRestore directory changed by pushdpopdpopdAll Windows versions
powercfgManage power settingspowercfg [-option] [arguments…]powercfg /listWindows XP and later
powershellWindows PowerShellpowershell [options] [-Command {- | script-block [-args arg-array] | string [command-arguments] | – file file-path [args]}]powershell -ExecutionPolicy Bypass -File script.ps1Windows 7 and later
printPrint text fileprint [/d:device] [[drive:][path]filename[…]]print document.txtAll Windows versions
promptChange command promptprompt [text]prompt $p$gAll Windows versions
pushdSave current directory and change to new onepushd [path]pushd \server\shareAll Windows versions

Commands Q-Z

CommandPrimary FunctionFull SyntaxExample UsageWindows Version Compatibility
qprocessDisplay processesqprocess {* | processname | processid} [/s computer [/u domain\user [/p password]]]qprocess *Windows XP and later
queryDisplay various system informationquery [process | session | termserver | user] [options]query userWindows XP and later
rd or rmdirRemove directoryrd [/s [/q]] [drive:]pathrd /s /q OldProjectAll Windows versions
recoverRecover readable info from damaged diskrecover [drive:][path]filenamerecover damaged.docAll Windows versions
regRegistry manipulationreg [operation] [parameters]reg query HKLM\SoftwareWindows XP and later
regsvr32Register/unregister DLLregsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllnameregsvr32 library.dllWindows XP and later
remRecord comments in batch filesrem [comment]rem This is a commentAll Windows versions
ren or renameRename filesren [drive:][path]filename1 filename2ren oldname.txt newname.txtAll Windows versions
replaceReplace filesreplace [drive1:][path1]filename [drive2:][path2] [options]replace c:\file.txt d:\backup\All Windows versions
resetReset a sessionreset session [/server:servername] [/v]reset session 1Windows XP and later
robocopyRobust file copyrobocopy source destination [file […]] [options]robocopy C:\Data D:\Backup /mirWindows Vista and later
routeManipulate network routing tablesroute [-f] [-p] [command [destination] [mask netmask] [gateway] [metric metric] [if interface]]route printAll Windows versions
runasRun command as different userrunas [{/user:domain\username | /smartcard}] [options] programrunas /user:DOMAIN\Admin cmdWindows XP and later
scService Controlsc [\server] [command] [service_name] [options]sc query wuauservWindows XP and later
schtasksSchedule tasksschtasks [/option [arguments]]schtasks /create /tn “Backup” /tr backup.bat /sc dailyWindows XP and later
setDisplay or set environment variablesset [variable=[string]]set PATH=%PATH%;C:\binAll Windows versions
setlocalBegin localization of environment changessetlocal [enableextensions | disableextensions] [enabledelayedexpansion | disabledelayedexpansion]setlocal enabledelayedexpansionAll Windows versions
setxSet environment variables permanentlysetx [/s computer [/u [domain]user [/p [password]]]] var value [/m]setx JAVA_HOME “C:\Program Files\Java\jdk1.8.0_92”Windows XP and later
sfcSystem File Checkersfc [/scannow] [other options]sfc /scannowWindows XP and later
shiftShift position of batch parametersshift [/n]shiftAll Windows versions
shutdownShutdown or restart computershutdown [options]shutdown /r /t 60All Windows versions
sortSort inputsort [options] [[file1] [/o file2]]dir | sort /+10All Windows versions
startStart program in a new windowstart [“title”] [options] [command] [parameters]start notepad report.txtAll Windows versions
substAssociate path with drive lettersubst [drive1: [drive2:]path]subst X: C:\LongPath\ProjectsAll Windows versions
systeminfoDisplay system informationsysteminfo [/s computer [/u domain\user [/p password]]] [/fo {TABLE | LIST | CSV}] [/nh]systeminfo /fo csvWindows XP and later
takeownTake ownership of filetakeown [/f file [/a] [/r [/d]]] [/s computer [/u [domain]user [/p [password]]]]takeown /f important.docWindows Vista and later
taskkillTerminate tasks/processestaskkill [options] [/pid id | /im name]taskkill /im notepad.exe /fWindows XP and later
tasklistList running tasks/processestasklist [options]tasklist /vWindows XP and later
timeDisplay or set system timetime [/t | time]time 14:30All Windows versions
timeoutWait for specified secondstimeout /t seconds [/nobreak]timeout /t 10Windows Vista and later
titleSet console window titletitle [string]title Command ProcessorWindows XP and later
tracertTrace route to hosttracert [options] target_nametracert -d google.comAll Windows versions
treeDisplay directory structure graphicallytree [drive:][path] [/f] [/a]tree C:\ /fAll Windows versions
typeDisplay contents of text filestype [drive:][path]filenametype config.iniAll Windows versions
tzutilTime zone utilitytzutil [/g] [/s timezoneid] [/l]tzutil /s “Eastern Standard Time”Windows Vista and later
verDisplay Windows versionververAll Windows versions
verifyVerify files were written correctlyverify [on | off]verify onAll Windows versions
volDisplay disk volume label and serial numbervol [drive:]vol C:All Windows versions
whereLocate fileswhere [/r dir] [/q] [/f] [/t] pattern…where /r C:\ notepad.exeWindows XP and later
whoamiDisplay current userwhoami [options]whoami /allWindows XP and later
windiffCompare files or directorieswindiff [options] file1 file2windiff oldfile.txt newfile.txtWindows XP (may require install)
wmicWindows Management Instrumentation Commandwmic [global switches] [alias] [verb] [properties]wmic process list fullWindows XP to 10 (deprecated in 10)
wscriptWindows Script Hostwscript [options] scriptname [arguments…]wscript //nologo script.vbsAll Windows versions
xcopyCopy files and directoriesxcopy source [destination] [options]xcopy C:\Source D:\Backup /s /e /h /iAll Windows versions
READ ALSO:  DeepSeek is the New ChatGPT Alternative: here's why and how To Try It
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x