Help

BAT2EXE

Extended commands

Bat To Exe Converter has some extended commands, that are not normally available in batch files.
You must use the prefix %extd% to call the extended commands.

AddExtension

Description

Add a file name extension to the given string

Syntax

%extd% /addextension string extension

Example

%extd% /addextension test .txt ; (This will return "test.txt")

Return value

Returns the result in the variable %result%

AesDecode

Description

Decode the given file using the AES algorithm

Syntax

%extd% /aesdecode source destination key

Example

%extd% /aesdecode encoded.aes file.txt mykey

Return value

This command has no return value

AesEncode

Description

Encode the given file using the AES algorithm

Syntax

%extd% /aesencode source destination key

Example

%extd% /aesencode file.txt encoded.aes mykey

Return value

This command has no return value

Ascii

Description

Returns the ASCII value of the specified character

Syntax

%extd% /ascii character

Example

%extd% /ascii A ; (This will return 65)

Return value

Returns the result in the variable %result%

Base64Decode

Description

Decode the given file using the Base64 algorithm

Syntax

%extd% /base64decode source destination

Example

%extd% /base64decode encoded.b64 file.txt

Return value

This command has no return value

Base64Encode

Description

Encode the given file using the Base64 algorithm

Syntax

%extd% /base64encode source destination

Example

%extd% /base64encode file.txt encoded.b64

Return value

This command has no return value

Bin

Description

Convert a number to a string in binary format

Syntax

%extd% /bin number

Example

%extd% /bin 32 ; (This will return 100000)

Return value

Returns the result in the variable %result%

BrowseForFile

Description

Open a dialog box to browse for a file

Syntax

%extd% /browseforfile title defaultfile pattern position

Example

%extd% /browseforfile "Browse for a file" "" "EXE (*.exe)|*.exe|BAT (*.bat)|*.bat" 1

Return value

Returns the result in the variable %result%

BrowseForFolder

Description

Open a dialog box to browse for a folder

Syntax

%extd% /browseforfolder title startpath

Example

%extd% /browseforfolder "Browse for a folder" C:\

Return value

Returns the result in the variable %result%

Char

Description

Returns the character of the specified ASCII value

Syntax

%extd% /char value

Example

%extd% /char 65 ; (This will return A)

Return value

Returns the result in the variable %result%

CloseWindow

Description

Close the specified window

Syntax

%extd% /closewindow windowname

Example

%extd% /closewindow Calculator; (This will close calculator)

Return value

This command has no return value

CRC32

Description

Calculate the CRC32 checksum of the given file

Syntax

%extd% /crc32 filename

Example

%extd% /crc32 myfile.txt; (This will calculate the CRC32 checksum of "myfile.txt")

Return value

Returns the result in the variable %result%

DisableWindow

Description

Disable the specified window

Syntax

%extd% /disablewindow windowname

Example

%extd% /disablewindow Calculator

Return value

This command has no return value

Download

Description

Download a file from the given URL

Syntax

%extd% /download url filename

Example

%extd% /download http://www.f2ko.de/downloads/Bat_To_Exe_Converter.zip Bat_To_Exe_Converter.zip

Return value

Returns the result (a value unequal to zero on success) in the variable %result%

EnableWindow

Description

Enable the specified window

Syntax

%extd% /enablewindow windowname

Example

%extd% /enablewindow Calculator

Return value

This command has no return value

FindExecutable

Description

Retrieves the name of the executable (.exe) file associated with a specific document file

Syntax

%extd% /findexecutable file

Example

%extd% /findexecutable file.txt

Return value

Returns the result in the variable %result%

GetClipboardText

Description

Returns the last pasted text in the clipboard

Syntax

%extd% /getclipboardtext

Example

%extd% /getclipboardtext

Return value

Returns the result in the variable %result%

GetComputerName

Description

Returns the computer name

Syntax

%extd% /getcomputername

Example

%extd% /getcomputername

Return value

Returns the result in the variable %result%

GetCPUName

Description

Returns the CPU name

Syntax

%extd% /getcpuname

Example

%extd% /getcpuname

Return value

Returns the result in the variable %result%

GetCursorPosX

Description

Returns the X position of the mouse in the desktop

Syntax

%extd% /getcursorposx

Example

%extd% /getcursorposx

Return value

Returns the result in the variable %result%

GetCursorPosY

Description

Returns the Y position of the mouse in the desktop

Syntax

%extd% /getcursorposy

Example

%extd% /getcursorposy

Return value

Returns the result in the variable %result%

GetDesktopHeight

Description

Returns the height of the desktop

Syntax

%extd% /getdesktopheight

Example

%extd% /getdesktopheight

Return value

Returns the result in the variable %result%

GetDesktopWidth

Description

Returns the width of the desktop

Syntax

%extd% /getdesktopwidth

Example

%extd% /getdesktopwidth

Return value

Returns the result in the variable %result%

GetExtension

Description

Retrieves the extension of the specified path

Syntax

%extd% /getextension path

Example

%extd% /getextension C:\test.txt ; (This will return "txt")

Return value

Returns the result in the variable %result%

GetFileName

Description

Retrieves the filename of the specified path

Syntax

%extd% /getfilename path

Example

%extd% /getfilename C:\test.txt ; (This will return "test.txt")

Return value

Returns the result in the variable %result%

GetPath

Description

Retrieves the path part of the specified path

Syntax

%extd% /getpath path

Example

%extd% /getpath C:\path\test.txt ; (This will return "C:\path\")

Return value

Returns the result in the variable %result%

GetSpecialFolder

Description

Retrieves the path of a special folder

Syntax

%extd% /getspecialfolder value

Values

ADMINTOOLS
ALTSTARTUP
APPDATA
BITBUCKET
CDBURN_AREA
COMMON_ADMINTOOLS
COMMON_ALTSTARTUP
COMMON_APPDATA
COMMON_DESKTOPDIRECTORY
COMMON_DOCUMENTS
COMMON_FAVORITES
COMMON_MUSIC
COMMON_OEM_LINKS
COMMON_PICTURES
COMMON_PROGRAMS
COMMON_STARTMENU
COMMON_STARTUP
COMMON_TEMPLATES
COMMON_VIDEO
COMPUTERSNEARME
CONNECTIONS
CONTROLS
COOKIES
DESKTOP
DESKTOPDIRECTORY
DRIVES
FAVORITES
FONTS
HISTORY
INTERNET
INTERNET_CACHE
LOCAL_APPDATA
MYDOCUMENTS
MYMUSIC
MYPICTURES
MYVIDEO
NETHOOD
NETWORK
PERSONAL
PRINTERS
PRINTHOOD
PROFILE
PROGRAM_FILES
PROGRAM_FILESX86
PROGRAM_FILES_COMMON
PROGRAM_FILES_COMMONX86
PROGRAMS
RECENT
RESOURCES
RESOURCES_LOCALIZED
SENDTO
STARTMENU
STARTUP
SYSTEM
SYSTEMX86
TEMPLATES
WINDOWS

Example

%extd% /getspecialfolder DESKTOPDIRECTORY

Return value

Returns the result in the variable %result%

GetSystemLanguage

Description

Retrieves the system language

Syntax

%extd% /getsystemlanguage

Example

%extd% /getsystemlanguage

Return value

Returns the result in the variable %result%

GetTickCount

Description

Retrieves the number of milliseconds that have elapsed since the system was started

Syntax

%extd% /gettickcount

Example

%extd% /gettickcount

Return value

Returns the result in the variable %result%

GetUserLanguage

Description

Retrieves the user language

Syntax

%extd% /getuserlanguage

Example

%extd% /getuserlanguage

Return value

Returns the result in the variable %result%

GetUserName

Description

Returns the user name

Syntax

%extd% /getusername

Example

%extd% /getusername

Return value

Returns the result in the variable %result%

Hex

Description

Convert a number to a string in hexadecimal format

Syntax

%extd% /hex number

Example

%extd% /hex 1000 ; (This will return 3E8)

Return value

Returns the result in the variable %result%

HideSelf

Description

Hide the main console window

Syntax

%extd% /hideself

Example

%extd% /hideself

Return value

This command has no return value

HideWindow

Description

Hide the specified window

Syntax

%extd% /hidewindow windowname

Example

%extd% /hidewindow Calculator ; (This will hide calculator)

Return value

This command has no return value

Input

Description

Read a line from the console input

Syntax

%extd% /input

Example

%extd% /input

Return value

Returns the result in the variable %result%

InputBox

Description

Open an input box

Syntax

%extd% /inputbox title message default

Example

%extd% /inputbox Title "Enter the text below" "I'm the default input"

Return value

Returns the result in the variable %result%

Is64Bit

Description

Determine whether your computer is running a 32-bit version or 64-bit version of Windows

Syntax

%extd% /is64bit

Example

%extd% /is64bit

Return value

Returns the result (1 = 64Bit) in the variable %result%

Left

Description

Extract a substring of a string from the left side

Syntax

%extd% /left string length

Example

%extd% /left String 3 ; (This will return "Str")

Return value

Returns the result in the variable %result%

LowerCase

Description

Returns the given string converted into lower case characters

Syntax

%extd% /lowercase string

Example

%extd% /lowercase STRING ; (This will return "string")

Return value

Returns the result in the variable %result%

LZMA

Description

Compress the given file using the LZMA algorithm

Syntax

%extd% /lzma source destination

Example

%extd% /lzma file.txt file.lzma

Return value

This command has no return value

MakeAdmin

Description

Add an administrator manifest to the exe

Syntax

%extd% /makeadmin infile.exe outfile.exe value

Values

0 : keep existing resources
1 : delete existing resources

Example

%extd% /makeadmin infile.exe outfile.exe 0

Return value

Returns the result (on success a value unequal to 0) in the variable %result%

MakeGuid

Description

Create a GUID string

Syntax

%extd% /makeguid

Example

%extd% /makeguid

Return value

Returns the result in the variable %result%

MakeShortcut

Description

Create a shortcut of the given file

Syntax

%extd% /makeshortcut source shortcut arguments description workingdirectory icon

Example

%extd% /makeshortcut "%~f0" "%~dp0Shortcut.lnk" "Arg1 Arg2 Arg3" "My Shortcut" "%~dp0" "%~f0"

Return value

This command has no return value

MakeToolWindow

Description

Change the window style to a tool window style

Syntax

%extd% /maketoolwindow windowname

Example

%extd% /maketoolwindow Calculator

Return value

This command has no return value

MaskedInput

Description

Read a line from the console while hiding the input

Syntax

%extd% /maskedinput

Example

%extd% /maskedinput

Return value

Returns the result in the variable %result%

MaskedInputBox

Description

Open an input box while hiding the input

Syntax

%extd% /maskedinputbox title message default

Example

%extd% /maskedinputbox Title "Enter the text below" "I'm the default input"

Return value

Returns the result in the variable %result%

MaximizeWindow

Description

Maximize the specified window

Syntax

%extd% /maximizewindow windowname

Example

%extd% /maximizewindow Calculator

Return value

This command has no return value

MD5

Description

Returns the MD5 fingerprint of the given file

Syntax

%extd% /md5 filename

Example

%extd% /md5 example.txt

Return value

Returns the result in the variable %result%

Mid

Description

Extract a substring from a string at the specified position

Syntax

%extd% /mid string position

Example

%extd% /mid String 3 ; (This will return "ring")

Return value

Returns the result in the variable %result%

MessageBox

Description

Display a messagebox

Syntax

%extd% /messagebox titel text flag

Example

%extd% /messagebox Error Message 16

Return value

Returns the result in the variable %result%

MessageBoxCheck

Description

Display a messagebox that gives the option of suppressing further occurrences

Syntax

%extd% /messageboxcheck titel text flag guid

Example

%extd% /messageboxcheck Titel Message 0 {73E8105A-7AD2-4335-B694-94F837A38E79}

Return value

Returns the result in the variable %result%

MinimizeWindow

Description

Minimize the specified window

Syntax

%extd% /minimizewindow windowname

Example

%extd% /minimizewindow Calculator

Return value

This command has no return value

MouseClick

Description

Simulate mouse clicks

Syntax

%extd% /mouseclick value

Values

-lc : left click
-rc : right click
-ldc : left double click
-rdc : right double click

Example

%extd% /mouseclick -rc ; (This will simulate a right click)

Return value

This command has no return value

MoveWindow

Description

Move the specified window

Syntax

%extd% /movewindow windowname x y

Example

%extd% /movewindow Calculator 100 100

Return value

This command has no return value

OSVersion

Description

Retrieve the version of the operating system

Syntax

%extd% /osversion

Example

%extd% /osversion

Return value

Returns the result in the variable %result%

Play

Description

Play the specified WAVE (.wav) file

Syntax

%extd% /play wavfile

Example

%extd% /play sample.wav

Return value

Returns the result in the variable %result%

Random

Description

Generate a random number

Syntax

%extd% /random maximum

Example

%extd% /random 1000

Return value

Returns the result in the variable %result%

RC4

Description

Crypt the given file using the RC4 algorithm

Syntax

%extd% /rc4 source destination key

Example

%extd% /rc4 file.txt file.rc4 samplekey

Return value

This command has no return value

ReadPreferenceValue

Description

Read a value associated with the specified key from the preference file

Syntax

%extd% /readpreferencevalue filename key

Example

%extd% /readpreferencevalue settings.ini appname

Return value

Returns the result in the variable %result%

RemoveExtension

Description

Remove the extension from the given string

Syntax

%extd% /removeextension string

Example

%extd% /removeextension test.txt ; (This will return "test")

Return value

Returns the result in the variable %result%

RenameExtension

Description

Replace the extension of the given string with a new one

Syntax

%extd% /renameextension string extension

Example

%extd% /renameextension test.txt bat ; (This will return "test.bat")

Return value

Returns the result in the variable %result%

ResizeWindow

Description

Resize the specified window

Syntax

%extd% /resizewindow windowname x y width height

Example

%extd% /resizewindow Calculator 0 0 100 100

Return value

This command has no return value

Description

Extract a substring of a string from the right side

Syntax

%extd% /right string length

Example

%extd% /right String 3

Return value

Returns the result in the variable %result%

SaveFileDialog

Description

Open a dialog box to save a file

Syntax

%extd% /savefiledialog title defaultfile pattern

Example

%extd% /savefiledialog "Save file as" "" "All Files (*.*)|*.*"

Return value

Returns the result in the variable %result%

Screenshot

Description

Take a screenshot of the desktop and save it as the given filename

Syntax

%extd% /screenshot filename

Example

%extd% /screenshot desktop.bmp

Return value

This command has no return value

SendKeys

Description

Simulate text input

Syntax

%extd% /sendkeys text

Example

%extd% /sendkeys text

Return value

This command has no return value

SetClipboardText

Description

Store the given string into the clipboard

Syntax

%extd% /setclipboardtext text

Example

%extd% /setclipboardtext text

Return value

This command has no return value

SetConsoleTransparency

Description

Set the transparency of the main console window

Syntax

%extd% /setconsoletransparency value

Values

0-100
0 : transparent
100 : opaque

Example

%extd% /setconsoletransparency 50

Return value

This command has no return value

SetCursor

Description

Move the cursor to the specified screen coordinates

Syntax

%extd% /setcursor x y

Example

%extd% /setcursor 100 100

Return value

This command has no return value

SetForegroundWindow

Description

Bring the specified window to the foreground

Syntax

%extd% /setforegroundwindow windowname

Example

%extd% /setforegroundwindow Calculator

Return value

This command has no return value

SetLeft

Description

Pad a string to the left by adding the specified character to fit the length

Syntax

%extd% /setleft string length character

Example

%extd% /setleft test 10 * ; (This will return "test******")

Return value

Returns the result in the variable %result%

SetRight

Description

Pad a string to the right by adding the specified character to fit the length

Syntax

%extd% /setright string length character

Example

%extd% /setright test 10 * ; (This will return "******test")

Return value

Returns the result in the variable %result%

SetWindowTitle

Description

Set the title of the specified window

Syntax

%extd% /setwindowtitle windowname title

Example

%extd% /setwindowtitle Calculator NewTitle

Return value

This command has no return value

SetWindowTransparency

Description

Set the transparency of the specified window

Syntax

%extd% /setwindowtransparency windowname value

Values

0-100
0 : transparent
100 : opaque

Example

%extd% /setwindowtransparency Calculator 50

Return value

This command has no return value

SHA1

Description

Returns the SHA1 fingerprint of the given file

Syntax

%extd% /sha1 filename

Example

%extd% /sha1 example.txt

Return value

Returns the result in the variable %result%

ShowSelf

Description

Show the main console window

Syntax

%extd% /showself

Example

%extd% /showself

Return value

This command has no return value

ShowWindow

Description

Show the previously hidden window again

Syntax

%extd% /showwindow windowname

Example

%extd% /showwindow Calculator

Return value

This command has no return value

Sleep

Description

Wait the specified number of milliseconds

Syntax

%extd% /sleep milliseconds

Example

%extd% /sleep 2000

Return value

This command has no return value

Speak

Description

Speak the specified text with the default voice

Syntax

%extd% /speak text speed

Example

%extd% /speak "This is a test" 2

Return value

This command has no return value

StrCount

Description

Count the number of times a substring occurs in a string

Syntax

%extd% /strcount string stringtocount

Example

%extd% /strcount "This is the sample string" is

Return value

Returns the result in the variable %result%

StrPos

Description

Search for the first occurrence of substring inside a string

Syntax

%extd% /strpos string searchstring

Example

%extd% /strpos "a sample string" "sample"

Return value

Returns the result in the variable %result%

StrReplace

Description

Replace some characters with some other characters in a string

Syntax

%extd% /strreplace string searchstring replacestring

Example

%extd% /strreplace "a sample string" sample replaced

Return value

Returns the result in the variable %result%

StrRev

Description

Reverse a string

Syntax

%extd% /strrev string

Example

%extd% /strrev "string to reverse"

Return value

Returns the result in the variable %result%

StrSplit

Description

Split a string using a separator

Syntax

%extd% /strsplit string index separator

Example

%extd% /strsplit "string;to;split" 1 ";"

Return value

Returns the result in the variable %result%

Tempfile

Description

Creates a name for a temporary file

Syntax

%extd% /tempfile directory

Example

%extd% /tempfile %temp%

Return value

Returns the result in the variable %result%

Trim

Description

Remove the specified character at the beginning and at the end of the string

Syntax

%extd% /trim string character

Example

%extd% /trim ****test**** * ; (This will return "test")

Return value

Returns the result in the variable %result%

TrimLeft

Description

Remove the specified character at the beginning of the string

Syntax

%extd% /trimleft string character

Example

%extd% /trimleft ****test**** * ; (This will return "test****")

Return value

Returns the result in the variable %result%

TrimRight

Description

Remove the specified character at the end of the string

Syntax

%extd% /trimright string character

Example

%extd% /trimright ****test**** * ; (This will return "****test")

Return value

Returns the result in the variable %result%

UnLZMA

Description

Decompress the given file using the LZMA algorithm

Syntax

%extd% /unlzma source destination

Example

%extd% /unlzma file.lzma file.txt

Return value

This command has no return value

UnZip

Description

Extract the contents of the specified Zip archive to the destination folder

Syntax

%extd% /unzip zipfile destination

Example

%extd% /unzip sample.zip c:\

Return value

This command has no return value

UpperCase

Description

Returns the given string converted into upper case characters

Syntax

%extd% /uppercase string

Example

%extd% /uppercase string ; (This will return "STRING")

Return value

Returns the result in the variable %result%

WindowOnTop

Description

Make the window stay on top

Syntax

%extd% /windowontop windowname

Example

%extd% /windowontop Calculator

Return value

This command has no return value

WritePreferenceValue

Description

Write a value associated with the specified key to the preference file

Syntax

%extd% /writepreferencevalue filename key value

Example

%extd% /writepreferencevalue settings.ini appname "myapp 1.0"

Return value

This command has no return value

Zip

Description

Add and compress the file/folder to the specified Zip archive

Syntax

%extd% /zip filetozip zipfile

Example

%extd% /zip sample.txt packed.zip

Return value

This command has no return value