Batch Files & Batch Commands

(DOS) commands and their usage in batch files

 

0..9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

Command Function Available in (3rd Party)
Replacement
DOS Win9x NT OS/2
ACINIUPD Modify INI files (TS only) N N Y N  
ANSI.SYS Text attributes, cursor & keyboard manipulation Y N N Y Download ANSI.COM (DOS only TSR)
APPEND Allows programs to open data files in specified directories as if they were in the current directory (DOS) Y Y Y Y DPATH
ARP Display or modify IP-to-Physical address translation tables used by ARP N Y Y Y  
ASSOC Associate a file extension with a file type, or list all associations N N Y N  
AT Command line scheduler N N Y Y JT, SCHTASKS
ATTRIB List & manipulate file attributes Y Y Y Y  
AUTOFAIL Suppress network connection error messages at startup N N N Y  
BACKUP Backup files to floppy disks (requires RESTORE from the exact same DOS version) Y Y N Y NTBACKUP, Several commercial image backup tools
BASICA Basic interpreter for IBM PC-DOS Y N N N GWBASIC, QBASIC
BCDEDIT Sets properties in boot database to control boot loading (Windows 7) N N W7 N  
BOOTCFG Edit Windows boot settings in BOOT.INI (XP) N N XP N  
BREAK Enable/disable extended Ctrl+C checking (16-bits) Y Y Y Y  
CACLS Read and set file access permissions N N Y N ICACLS (Windows 7), SECEDIT, SUBINACL, XCACLS
CALL Run a batch file from within another batch file Y Y Y Y  
CD Show or change the current directory (same as CHDIR) Y Y Y Y  
CDBURN Write ISO images to CD (Windows Server 2003 Resource Kit tool) N N 2K3RK N Download Image Burn
CERTREQ Request certificates from a certification authority (Windows Server 2003) N N Y N  
CERTUTIL Manage certificates (Windows Server 2003) N N Y N  
CHANGE Change TS port mappings, install mode, or enable/disable TS logon N N TS N  
CHCP Display or set the active Code Page Y Y Y Y MODE
CHDIR Show or change the current directory (same as CD) Y Y Y Y  
CHGLOGON Enable/disable TS logon N N Y N  
CHGPORT Change TS port mappings N N TS N  
CHGUSR Change TS install mode N N TS N  
CHKDSK Check a disk for file system errors or bad sectors Y Y Y Y  
CHKNTFS Display or modify the checking of disk at boot time N N Y N  
CHOICE Prompt user for to choose option from list of choices 6 Y N N PMChoice
CIPHER Display or alter the encryption of directories [files] on NTFS partitions N N Y N  
CLEANMGR Automate cleanup of temporary files, IE cache, downloaded files & recycle bin (XP) N N XP N  
CLS Clear the screen/window Y Y Y Y  
CMD.EXE Command interpreter (32-bits) N N Y Y  
CMDKEY Manage stored user names and passwords (Windows Server 2003 and later) N N 2K3 N  
COLOR Change text and background color in console N N Y N  
COMMAND.COM Command interpreter (16-bits) Y Y Y Y  
COMP Compare files Y Y Y Y FC, Download my TXTCOMP scripts TxtComp, WINDIFF (GUI)
COMPACT Display or modify file compression on NTFS partitions N N Y N  
%COMSPEC% Command interpreter specification in master environment Y Y Y Y  
CONTROL Start Control Panel or a Control Panel applet N Y Y Y RUNDLL32 SHELL32.DLL,Control_RunDLL
CONVERT Convert a FAT volume to NTFS N N Y N  
COPY Copy files Y Y Y Y ROBOCOPY, XCOPY
CPROFILE Clean profiles of wasted space (Windows Server 2003) N N 2K3 N  
CSCRIPT Console mode interpreter for VBScript/JScript N Y Y N  
CSVDE Import/export data from Active Directory in CSV format N N 2K N  
CTTY Redirect all input and output to a file or (serial, parallel or null) device Y N N N  
DATE Display & manipulate system date Y Y Y Y  
DEBUG Debugger & assembler Y Y Y Y  
DEFRAG Locate and consolidate fragmented boot files, data files, and folders on local volumes Y Y Y N  
DEL Delete one or more files Y Y Y Y  
DELTREE Delete an entire folder including files and subfolders Y Y N N RD /S
DEVCON Command line Device Manager (free Microsoft download) N N Y N  
DHCPLOC Discover rogue DHCP servers N N XP N  
DIANTZ Compress and add files to new or existing .CAB files(equivalent of MAKECAB) N N Y N MAKECAB
DIR List files & directories Y Y Y Y  
DISKCOMP Compare two floppy disks on a track by track basis Y Y Y Y  
DISKCOPY Copy a floppy disks on a track by track basis Y Y Y Y  
DISKPART Manipulate harddisk partitions and logical drives N N 2K N Acronis Disk Director
DOSKEY Edit or recall command lines, or create command line macros Y Y Y Y  
DPATH Allows programs to open data files in specified directories as if they were in the current directory (Windows 7, OS/2) N N W7 Y APPEND
DRIVERQUERY List installed drivers (Windows XP) N N XP N  
DSADD Add objects to (active) directory N N 2K N  
DSGET Display (active) directory object properties N N 2K N  
DSMOD Modify objects in (active) directory N N 2K N  
DSMOVE Move or rename objects in (active) directory N N 2K N  
DSQUERY Query (active) directory N N 2K N  
DSRM Remove object from (active) directory N N 2K N  
DVDBURN Write ISO images to DVD (Windows Server 2003 Resource Kit tool) N N 2K3RK N Download Image Burn
ECHO Display text on screen Y Y Y Y  
EDIT Text editor in MS-DOS 5+ (requires QBASIC) Y Y Y N EDLIN
EDLIN Line editor in MS-DOS 4- Y N N N EDIT, COPY CON, many programmers' editors
ENDLOCAL Terminate local environment N N Y Y  
EPAL Elevated Priviliges Application Launcher (free Microsoft download) N N Y N RUNAS, Download CPAU, Download PSEXEC, Download RunAs Pro
ERASE Delete one or more files Y Y Y Y  
EVENTCREATE Write an event in one of the event logs N N XP N  
EVENTQUERY.VBS List events and event properties N N XP N  
EVENTTRIGGERS Display and configure "Event Triggers" that monitor and act upon the occurrence of NT Log Events of given criteria N N XP N  
EXIT Terminate a batch file or command prompt Y Y Y Y  
EXPAND Expand compressed files or folders on NTFS volumes N N Y Y  
EXPLORER Open a folder in an Explorer window N Y Y N  
EXTRACT Extract compressed files N Y Y N Download 7-ZIP 7-Zip, Download WinRAR WinRAR
EXE2BIN Convert .EXE files to binary format (DOS) Y Y Y Y  
FASTOPEN Open DOS programs faster by memorizing their locations on disk (DOS) Y Y Y Y  
FC Compare files Y Y Y Y COMP, Download my TXTCOMP scripts TxtComp, WINDIFF (GUI)
FDISK Manipulate harddisk partitions and logical drives Y Y N Y DISKPART, Acronis Disk Director
FILEVER Display a program file's version N N Y N Located in the Support Tools folder on the Windows XP installation CD, Download XP SP2 Support Tools download XP SP2 Support Tools
FIND Search files or standard output Y Y Y Y  
FINDRAMD Find the RAM drive letter N Y N N  
FINDSTR Search files or standard output with advanced options N N Y Y Download EGREP
FOR Loop through a set of files or variables Y Y Y Y FORFILES (W2K3)
FORCEDOS Force XP to start the specified program in the MS-DOS subsystem N N XP N  
FORFILES Selects and executes a command on a file or set of files N N 2K3 N FOR
FORMAT Format disks (intialize file system) Y Y Y Y  
FSUTIL Manage FAT and NTFS file systems (XP) N N XP N  
FTP File Transfer Protocol client N N Y Y TFTP, Fileaze
FTYPE Display or define the "Open" command for a file type N N Y N  
GETMAC Display MAC address for local or remote network adapters (XP and later) N N XP N Download my GETMAC and MACADDR scripts MacAddr
GETTYPE Queries the OS type, version or SP and returns it as an errorlevel (Resource Kit tool) N N Y N  
GOTO Jump to a label or subroutine Y Y Y Y  
GPRESULT Enable display of extended character set in graphics mode N N XP N  
GRAFTABL Enable display of extended character set in graphics mode Y Y Y Y  
GWBASIC Basic interpreter for MS-DOS up to version 4 Y N N N BASICA, QBASIC
HELP Display help text for a command Y Y Y Y  
ICACLS Display, modify, backup, or restore ACLs for files and directories (Windows 7) N N W7 N CACLS, SECEDIT, SUBINACL, XCACLS
IEXPRESS (Installation) script packager (XP) N N XP N  
IF Test statement Y Y Y Y  
IFCONFIG Configure network adapters N N N Y  
INUSE Replace locked files on the next reboot (Resource Kit tool) N N Y N  
IPCONFIG Configure network adapters N Y Y N  
JT Command line scheduler for Windows 2000 and later (Resource Kit utility) N N 2K N AT, SCHTASKS, Download Fileaze trial Fileaze
LABEL Show or set a disk's volume label Y Y Y Y  
LFNFOR Tells the FOR command to use either "8.3" or long file names N Y N N  
LH Load TSRs in high memory (same as LOADHIGH) Y Y N N  
LOADHIGH Load TSRs in high memory (same as LH) Y Y N N  
LOCK Grant 16-bits DOS programs direct access to a disk N Y N N  
LOGMAN Command line Performance Monitor management tool N N W2K8 N  
LOGOFF Logoff/terminate Windows TS sessions or (local) OS/2 N N TS Y  
MAKECAB Compress and add files to new or existing .CAB files (equivalent of DIANTZ) N N Y N DIANTZ
MD Create a new (sub)directory (same as MKDIR) Y Y Y Y  
MEM Check memory usage (MS-DOS and 16-bits sessions only) Y Y Y Y  
MKDIR Create a new (sub)directory (same as MD) Y Y Y Y  
MKLINK Create a symbolic link N N W7 N Download JUNCTIONJUNCTION
MODE Configures system devices Y Y Y Y  
MORE Displays output one screen at a time Y Y Y Y  
MOUNTVOL Create, delete or list volume mount points (XP) N N XP N  
MOVE Move or rename files or folders Y Y Y Y  
MSD Query for basic system configuration information (MS-DOS 6 & 7) Y Y N N several (commercial) system inventory tools
MSG Send a popup message to TS users/sessions N N TS N  
MSIEXEC Install, modify, and perform operations on Windows Installer from the command line N Y Y N  
MSINFO32 Query for basic system configuration information (Windows 2000+) N Y 2K N SYSTEMINFO, WINMSD, several (commercial) system inventory tools
NBTSTAT Display protocol statistics and current TCP/IP connections using NBT N N Y N  
NET Command line NetBIOS tool N Y Y Y  
NETDOM Manage domains and trust relationships (join computers to a domain, rename computers, and more) N N XP N  
NETSH Command line network configuration tool for Windows XP and later N N XP N  
NETSTAT Command line NetBIOS tool N Y Y Y  
NLTEST Command line Netlogon management tool N N XP N  
NOTEPAD Text editor (GUI editing, command line & GUI printing) N Y Y N Many programmers' editors
NSLOOKUP Diagnose DNS infrastructure N N Y N (PING -a for finding host names)
NTBACKUP Backup files to any Windows supported media N N Y N Several commercial image backup tools
OCSETUP Windows Optional Component Setup (Windows 7) N N Vista N  
ODBCCONF MDAC ODBC configuration tool N N Y N  
OPENFILES List or disconnect open files and folders N N Y N  
PATH Display or change the program search path Y Y Y Y  
PATHPING Extended PING utility N N 2K N TRACERT
PAUSE Wait until a key is pressed Y Y Y Y  
PENTNT Detects floating point division error (if present) in the Pentium chip, disables floating point hardware, and turns on floating point emulation N N Y N  
PING Check the TCP/IP connection to a remote IP address N Y Y Y  
PING6 IPv6 version of PING N N Y N  
PKGMGR Command line package manager N N Vista N  
POPD Move back to the last directory that was "pushed" on the stack by PUSHD N N Y Y  
POWERCFG Configure power management (Windows Server 2003) N N 2K3 Y  
PRINT Print a text file Y Y Y Y  
PRINTUI.EXE Shorthand command for RUNDLL32 PRINTUI.DLL,PrintUIEntry (Windows 7) Y Y W7 Y  
PRNCFG.VBS Configure or display printer configuration information N N 2K N  
PRNDRVR.VBS Add, delete, or list printer drivers N N 2K N  
PRNJOBS.VBS Pause, resume, cancel, or list print jobs N N 2K N  
PRNMNGR.VBS Add, delete, or lists printers or printer connections; set or display default printer N N 2K N  
PRNPORT.VBS Create, delete, or lists standard TCP/IP printer ports; display or change port configuration N N 2K N  
PRNQCTL.VBS Print a test page; pause or resume a printer; clear a printer queue N N 2K N  
PROMPT Configure the DOS prompt string Y Y Y Y  
PUBPRN.VBS Publish a printer in Active Directory N N 2K N  
PUSHD Move to a new directory, "pushing" the current directory on the stack N N Y Y  
QAPPSRV Query available TS application servers N N TS N  
QBASIC Basic interpreter for MS-DOS 5+ Y N N N BASICA, GWBASIC
QCHAIN Install multiple hotfixes with only a single reboot N N Y N  
QFARM Query local TS farm N N TS N  
QPROCESS Query TS servers for running processes N N TS N  
QSERVER Query available ICA-enabled TS servers N N TS N  
QUERY Query TS resources N N TS N  
QUSER Query logged on TS users N N TS N  
QWINSTA Query TS sessions N N TS N  
RASDIAL Use existing RAS/DUN connections N N Y N  
RASPHONE Manage RAS/DUN connections N N Y N  
RD Remove a (sub)directory (same as RMDIR) Y Y Y Y  
READLINE Read a single line from standard output N N N Y  
RECIMG Configures the recovery image Windows uses to refresh your PC N N W7 N  
RECOVER Recover readable information from a bad or defective disk (may sometimes destroy other files in the process) Y Y Y Y Download STRINGS, Several commercial undelete & file recovery tools
REG Read and write the registry (W2K and later) N N 2K N  
REGEDIT Read and write the registry (GUI as well as command line) N Y Y Y  
REGEDT32 Read and write the registry (includes setting access permissions) N N Y N REG, REGEDIT, SECEDIT
REGINI Read and write the registry, including permissions (NT4 Resource Kit, native in XP) N N Y N SUBINACL, SECEDIT
REGSVR32 Register .DLL & .OCX files as command components in the registry N N Y N  
REM Insert comment line Y Y Y Y  
REN Rename a file or folder (same as RENAME) Y Y Y Y Download Bulk Rename Command, Download Bulk Rename (GUI)
RENAME Rename a file or folder (same as REN) Y Y Y Y
REPLACE Copy only files that already exist in the target directory, or copy only files that don't exist yet Y Y Y Y XCOPY /U
RESET SESSION Reset TS session subsystem defaults N N TS N  
RESTORE Restore files backed up with BACKUP (from the exact same DOS version) Y Y N Y NTBACKUP, Several commercial image backup tools
RMDIR Remove a (sub)directory (same as RD) Y Y Y Y  
ROBOCOPY Copy directories, optionally including subdirectory trees and/or permissions, and optionally deleting removed files in the target directory (Resource Kit utility, native in Windows 7) N N Y N  
ROUTE Display and modify the entries in the local IP routing table N N Y Y  
RUNAS Run a command with different credentials (will always prompt for a password; use CPAU if you need to make this unattended) N N 2K N Download CPAU, EPAL, Download PSEXEC, Download RunAs Pro
RUNDLL Command line wrapper for 16-bit DLL routines N Y Y Y  
RUNDLL32 Command line wrapper for 32-bit DLL routines N Y Y N  
SC Command line services managment (XP) N N 2K N SERVICES.MSC (GUI), SUBINACL
SCHTASKS Command line task scheduler (XP) N N XP N AT, JT
SECEDIT Configure and analyze system security by comparing your current configuration to a template (Windows 2000+) N N 2K N CACLS, ICACLS (Windows 7), REGINI, SUBINACL, XCACLS
SET Manipulate environment variables Y Y Y Y  
SETLOCAL Start local environment N N Y Y  
SFC Scans the integrity of all protected system files and replaces incorrect versions with correct ones. N N 2K N  
SHADOW Monitor or take over a TS session N N TS N  
SHELL Primary command interpreter specification in CONFIG.SYS Y Y N Y  
SHIFT Parse command line variables in batch files Y Y Y Y  
SHUTDOWN Shutdown a computer (Resource Kit utility for NT 4 and 2000, native in XP and later) N N Y N TSSHUTDN, Download PSSHUTDOWN
SORT Read a file or standard input and return it sorted alphabetically Y Y Y Y  
START Run a command in a separate process, or run a file with its default associated application N Y Y Y  
SUBINACL Display/modify ACEs for file and folder permissions, ownership and domain (Resource Kit utility) N N Y N CACLS, ICACLS (Windows 7), REGINI, SC, SECEDIT, XCACLS
SUBST Associate or disassociate a drive alias with a path Y Y Y Y  
SYSTEMINFO Query for basic system configuration information N N XP N WINMSD, several (commercial) system inventory tools
TASKKILL Kill an active process (XP) N N XP N Download PSKILL
TASKLIST List active processes (XP) N N XP N Download PSLIST
TIME Display & manipulate system time Y Y Y Y  
TITLE Set the window title for the command prompt window N N Y N  
TRACERT Analyze the response times on the route to a remote IP address N Y Y N  
TRACERT6 IPv6 version of TRACERT N N Y N  
TRACERTE Analyze the response times on the route to a remote IP address (OS/2) N N N Y  
TREE "Graphically" display the folder structure of a drive or path Y Y Y Y  
TRUENAME Display the real fully qualified path Y Y Y Y  
TSCON Attach a TS user session to a terminal session N N TS N  
TSDISCON Disconnect a TS terminal session N N TS N  
TSKILL Terminate a process in a TS session N N TS N Download PSKILL
TSPROF Copy/update TS user configuration information N N TS N  
TSSHUTDN Shut down or reboot a TS server N N TS N Download PSSHUTDOWN
TYPE Display text file content in console Y Y Y Y  
TZCHANGE Configure/edit time zones N N XP N  
UNLOCK Revoke 16-bits direct disk access granted by the LOCK command N Y N N  
VER Display the OS version Y Y Y Y  
VERIFY Enable/disable verification of disk write operations Y Y Y Y  
VHDMOUNT Mount and access VHD files as virtual disk drives (part of Virtual Server 2005 R2 SP1) N N 2K N  
VOL Display a disk's volume label Y Y Y Y  
WINMSD Query for basic system configuration information (for Windows NT 4; in Windows 2000 WINMSD was replaced by MSINFO32) N N Y N MSINFO32, SYSTEMINFO, several (commercial) system inventory tools
WINMSDP Command line helper tool for WINMSD N N Y N
WMIC Query & manipulate objects in WMI (XP Pro and later) N N XP N  
WSCRIPT GUI mode interpreter for VBScript/JScript N Y Y N  
WUPDMGR Start Windows Update in Internet Explorer N Y 2K N  
XCACLS Read and set file access permissions (improved CACLS from the Resource Kits) Y Y Y Y CACLS, ICACLS (Windows 7), SECEDIT, Download SUBINACL
XCOPY Copy files & directories with advanced options Y Y Y Y ROBOCOPY, Download XXCOPY

 

Notes: (1) This list is by no means complete.
Only a selection of all commands that can be run in unattended mode from the command line is listed. For a complete list, download and run my AllHelp.vbs (or AllHelp.bat) to create your own custom version of allhelp.html.
  (2) Not all commands are available in all OS versions: CHOICE for example, is available in MS-DOS versions 6.* and 7.* (Windows 95/98) only, TSSHUTDN and other TS commands are available only on Terminal Servers and TS client PCs, DSADD and other AD commands are available only on Active Directory servers and client PCs with the Windows 2000/2003 administrator tools ADMINPAK.MSI) installed, etc.
  (3) For an up-to-date listing of commands available in the latest Windows versions, see Microsoft's Command-line reference A-Z.
  (4) To everyone who sent me corrections: thanks for helping me keep this list accurate.

 

0..9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

Fileaze

page last uploaded: 24 January 2014, 11:20