Enhanced Batch

Enhanced Batch is a solution to improve the functionality of your classic Windows batch files.

Get started now View it on GitHub


Applying a technique called Windows API Hooking, we have added capabilities never seen before.

You can store variables internally in a space called heap, instead of the environment block, saving the overhead of this last.

These heap variables begin with the $ prefix.

Also, there are extensions identified with the @ prefix.

Additionally, some bugs of cmd.exe are fixed.

Example of heap variable:

Set $myPrivateVar=Okay
Rem Looking in the environment block, it will say not defined.
Set $myPrivateVar
Rem Looking in the heap also
If Defined $myPrivateVar (
Echo Yep, it is defined in the heap
Echo $myPrivateVar = %$myPrivateVar%

The extensions can have getters and setters.

Example of an extension, in this case @unicode:

Echo Working with unicode: %@unicode%
If "%@unicode%"=="0" (
Echo Enabling unicode
Set "@unicode=1"

Getting started

  1. Just download the DLLs from the release.

  2. Load the library and verify the result with the following command at the start of your batch script:

Rundll32 "%~dp0enhancedbatch_%processor_architecture%" Load
If Not Defined @enhancedbatch (
Echo Load Failed

Alternatively, you can use this brief method:

Regsvr32 /e "%~dp0enhancedbatch_%processor_architecture%" || (
Echo Load Failed

If DLL could not be loaded a messagebox dialog will appear indicating the cause.


Enhanced Batch requires the command interpreter for Windows (cmd.exe).

About the project

Enhanced Batch is:

© 2019 by Carlos Montiers A.

© 2019 by Jason Hood


Jason Hood

Carlos Montiers

Petr Lázňovský

Steffen Illhardt

Dave Benham


Enhanced Batch is distributed by an zlib license.


When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.