Batch File Commands

RECENT NEWS

12/18/2015 - Hello! We're excited to announce that Mental Works Computing Software will soon be featuring

12/11/2015 - We're going to announce Dr.Batcher 3.0 Alpha with batch files debugger support soon. If you want to start...

News history...

TESTIMONIALS

Rob van der Woude:
"Mental Works Computing Software has created a nice tool for...

Andrew Jaritsyn:
“I used to write batch files with the help of Notepad, but...

Steve H.:
“This tool helped me to write some batch files in a couple...

More...

Here you can find detailed description of commands commonly used in batch file programming.

ASSOC

Displays or modifies the association between file extension and file type.

AT

Runs commands or programs on the computer at the specified time and day. Works only when Schedule service is running.

ATTRIB

Displays or changes attributes of files and folders.

BREAK

Allows user to interrupt the execution of the application with Ctrl+C keys. Used for backward compatibility  with old DOS batch files.

CABARC

Packs file into cabinet archive (.CAB) or extracts them from it.

CACLS

Displays or changes ACLs (access control list) files.

CALL

Calls a batch file from another batch file or jumps to the label into current batch file.

CD

Shows or changes the current directory. The same with CHDIR command.

CHDIR

Shows or changes the current directory. The same with CD command.

CHCP

Displays or changes the number of the active console code page.

CHKDSK

Checks disk for consistency, repairs file system problems and displays the status report.

CHKNTFS

Displays or modifies the state of automated file system checking on disk when computer starts.

CLS

Clears the console from any symbols left from the previously executed commands.

CMD

Starts the new instance of command line interpreter.

COLOR

Sets the console background and foreground colors.

COMP

Compares files or sets of files.

COMPACT

Displays or changes the compression of files and directories on NTFS partitions.

CONVERT

Converts FAT/FAT32 partitions to NTFS.

COPY

Copies files from one location to another.

DATE

Displays or changes the current system date.

DEL

Deletes file(s) from computer. The same with ERASE command.

DIR

Lists files and subdirectories in the given directory.

DISKCOMP

Compares contents of two floppy disks.

DOSKEY

Recalls and edits commands at the DOS prompt and creates macros.

ECHO

Turns command-echoing on/off, or displays a message on screen.

ENDLOCAL

Ends the localization of environment changes in your batch file.

ERASE

Deletes file(s) from computer. The same with DEL command.

EXIT

Exits the current batch file or the command processor.

FC

Compares two files and displays differences between them.

FIND

Searches for the specified string in text file(s) and reports lines found with that string.

FINDSTR

Searches for strings (text patterns) in files.

FOR

Runs a command in a loop (several times).

FORMAT

Formats a disk into one of supported by Windows file systems.

FTYPE

Displays or changes file types for associations.

GOTO

Makes the execution process jump to the specified line of the batch file.

GRAFTABL

Enables Windows to display extended characters in graphic mode.

HELP

Provides information on system commands.

IF

Performs a command conditially.

LABEL

Shows or modifies the volume label of the disk.

MD

Creates a new directory. The same with MKDIR command.

MKDIR

Creates a new directory. The same with MD command.

MODE

Displays status and changes settings of ports and devices.

MORE

Displays one screen output at time.

MOVE

Moves file(s) from one folder to another.

PATH

Displays or sets the search path to executable files.

PAUSE

Suspends the batch file execution and displays the message “Press any key to continue…”.

POPD

Changes the current folder with the folder saved with PUSHD command.

PUSHD

Stores the current folder name for further use by POPD command and changes it to the specified directory.

PRINT

Sends text file(s) to a printer.

PROMPT

Changes the command prompt of CMD.exe.

RD

Removes a directory. The same with RMDIR.

RMDIR

Removes a directory. The same with RD.

RECOVER

Recovers readable data from a bad disk.

REM

Starts comment in batch files.

REN

Renames file(s). The same with RENAME command.

RENAME

Renames file(s). The same with REN command.

REPLACE

Replaces/updates file(s) with other file(s).

SET

Sets, changes or removes command line environment variables.

SETLOCAL

Starts the localization of environment changes in your batch file.

SHIFT

Changes the positions of the batch file parameters.

SORT

Sorts line-by-line the input data.

START

Starts a program, command or batch file (in a new window).

SUBST

Creates or deletes a virtual drive by associating a path with a drive letter.

TIME

Changes or displays the system time.

TITLE

Sets the title of a new Command Prompt window.

TREE

Displays graphically the structure of a specified folder.

TYPE

Displays the contents of text file(s).

VER

Shows version of the operating system.

VOL

Shows disk volume label and serial number if they are available.

XCOPY

Copies files and folders, including subfolders.

 

Subscribe batch files programming newsletter (no spam):

Subscribe

Unsubscribe