• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Part III: Appendixes > Built-In and Batch File Commands

Built-In and Batch File Commands

The following commands are implemented by CMD.EXE and perform basic file and console window management functions as well as provide the basis for the batch file programming language.

Program Purpose
assoc Associates filename extensions with file types
break Causes breakpoint if cmd is run in a debugger
call Calls subroutines (batch files)
cd Challenges the current working directory (same as chdir)
chcp Changes the console code page
chdir Changes the current working directory
cls Clears the command prompt window
cmd Command shell
color Changes the Command Prompt window color
copy Copies files and/or folders
date Displays or sets the date
del Deletes files (same as erase)
dir Displays a file directory
echo Displays text
endlocal Restores environment variables
erase Deletes files (same as del)
exit Ends a program or subroutine
for Repeat command (many options)
ftype Associates file types to “open” commands
goto Goes to the label in a batch file
help Displays command-line program usage information
if Executes a command conditionally
md Creates a directory (same as mkdir)
mkdir Creates a directory (same as md)
move Moves files or folders
path Sets the command search path
pause Stops a batch file until the user presses Enter
popd Restores the current directory
prompt Sets the command-line prompt
pushd Saves the current directory
rd Removes a directory (same as rmdir)
rem Remarks or comments text
ren Renames files or folders (same as rename)
rename Renames files or folders (same as ren)
rmdir Removes a directory (same as rd)
set Sets environment variables
setlocal Saves the current environment
shift Deletes and moves command-line arguments
start Runs a command or opens a document in a new window
time Displays and sets the time of day
title Sets the window title
type Copies a text file to the console window
ver Displays the operating system version
verify Controls automatic verify-after-write
vol Displays disk volume label



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint