Bat To Exe Converter is a portable free tool which converts batch or CMD scripts to exe files. This brings several advantages. You can be sure others won't be able to view or edit your scripts. They'll run without any annoying console window. Bat To Exe by BlackHost is another good and intuitive Bat to Exe converter software for Windows. It allows you to convert a BAT file to EXE instantly. You can even edit a batch script or write a new batch script to get the corresponding EXE file. Option to add an icon to EXE is an added advantage.
Active7 months ago
There are many reasons to want to 'convert' a
.bat
to .exe
- to hide/obfuscate implementation, passwords, path to resources , to create a service from batch file .. and mainly to make your work to look more complicated and important than it really is.There are also many reasons to not want to use third party tools.
So what if you want to 'convert' a batch file to
.exe
without external software?(convert is in quotes because I don't think there's really way to compile a batch file to executable. There are too many abusive twisty techniques and bugs used extensively and all the tools that I know in fact create a temporary .bat
file and then call it )npocmaka
npocmakanpocmaka43.8k1111 gold badges9696 silver badges138138 bronze badges
![Exe Exe](/uploads/1/2/4/9/124912041/791998555.png)
3 Answers
One very obvious approach is to use IEXPRESS - the ancient built-in tool that creates self-extracting packages and is capable to execute post extraction commands.So here's IEXPRESSsed-directive/.bat file that creates a self-extracting .exe with packed .bat.It accepts two arguments - the .bat file you want to convert and the target executable:
example:
This should work practically on every Windows machine out there but has one major limitation - you cannot pass arguments to the created .exe file
So one other possible approach is to look at the .NET compilers (again should be available on almost every win machine).I've choose Jscript.net .This is a hybrid
jscript.net
/.bat
script that will read the .batch file content.Will create another jscript.net with the .bat file content and after the compilation will create a new bat file int the temp folder and will call it.And will accept command line arguments.(explained might look complex but in fact it's simple):It's rather a POC , but .NET System.Diagnostics and System.IO libraries are powerful enough to add features like hidden start , enctiption and etc.You can check also jsc.exe compiling options to see what else is capable of (like adding resources).
Willing victim pdf free download. I promise an upvote to every improvement over the .NET method :-)
Bat File To Exe Converter Mac
UPDATE: the second script has been changed and now the exe from the converted bat file can be started with double click.It uses the same interface as previous script:
npocmakanpocmaka43.8k1111 gold badges9696 silver badges138138 bronze badges
I do know how to convert bat/cmd to exe manually, make sure the bat/cmd filename contains just letters, and numbers. Open 'IExpress Wizard' as admin.
- Select 'Create new Self Extraction Directive file'
- Select 'Extract files and run an installation command'
- Name the package anything
- 'No prompt' for 'Confirmation prompt'
- 'Do not display a license' for 'License agreement'
- Click 'Add' for the 'Packaged files', from there select the bat/cmd file
- Then in 'Install Program' text box for 'Install Program to Launch', type
cmd /c
, followed by the full name of the bat/cmd file, (example:emptyrecyclebin.bat
=>cmd /c emptyrecyclebin.bat
) - Leave the 'Post Install Command' as is
- 'Hidden' for 'Show window'
- 'No message' for 'Finished message'
- Click 'Browse', and select where to download the exe to
- Enable 'Hide File Extracting Progress Animation from User'
- Disable 'Store files using Long File Name inside Package'
- Definitely 'No restart' for 'Configure restart'
- Then save SED if you want to re-compile it quicker later
- Then create the package! A command window should quickly appear and disappear
- Navigate to the place where you downloaded the exe to, andenjoy!
Community♦
TheRealSuicuneTheRealSuicune
You can also develop a simple exe, which just calls your bat-script.
For example you could write one in C# (I'm no C#-Pro, this is actually my first program and I copied lots of it from this other Stackoverflow post.):
If you store this code above to MySuperApp.cs just next to MySuperApp.bat and then compile it with
csc.exe /target:winexe MySuperApp.cs
(and maybe even add /win32icon:MySuperApp.ico
to add a fancy icon) it will generate a MySuperApp.exe.![Bat file to exe converter windows 10 Bat file to exe converter windows 10](/uploads/1/2/4/9/124912041/909707711.png)
Launching
MySuperApp.exe
will call MySuperApp.bat (the bat-file with the same name).csc.exe
(should?) be present on every Windows machine.ItchyItchy