Show Menu
Cheatography

Batch (.bat file) Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

About

consists of a series of commands
executed by the comman­d-line interp­reter
stored in a plain text file
(https­://­en.w­ik­ipe­dia.or­g/w­iki­/Ba­tch­_file)

Passing parameters

%0
The program name as it was called
%1 to %9
The command line parameters

Formatting

@
Commands starting with @ are not printed in the console
REM
Starts a comment (1-liner)

Basic commands

set
Defines the value of a variable.
 

Special variables

%error­level%
%cd%
current working directory
%time%
%date%
%comspec%
%Random%
%CmdEx­tVe­rsion%