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.
Active7 months ago
- Bat File To Exe Converter Free Download
- Batch File To Exe Converter
- Batch File To Exe Converter Online
- Batch File To Executable Converter
- Bat File To Exe Converter Download
There are also many reasons to not want to use third party tools.
- Advanced BAT to EXE Converter is the first and only compiler that will work for all complex batch files without the need to make specific changes to your script based on which compiler you are using with Intelli-Parse technology. Less hassle=less development time.
- Bat to Exe Converter. Batch File Converter turn your batch files into actual program (.EXE format) in one click. An.EXE file is much harder to casually reverse-engineer, so this could be a way to conceal a particular batch file's operations from an end user.
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 )
In this tutorial we learn how to convert batch files into exe files. Here on Technologycrazy we like have some fun. Avg free download full version 2018. Stay tooned to the end to see a really cool free program in action! I made a little modification to accept one argument: Just the.bat file you want to convert. So in this case, you can drag and drop your batch file over this script bat2exeIEXP.bat and it will be converted to exe file with the same name as the batch file.
npocmaka
npocmaka
43.8k11 gold badges96 silver badges138 bronze badges
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).
I promise an upvote to every improvement over the .NET method :-)
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:
npocmakanpocmaka
43.8k11 gold badges96 silver badges138 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.
Launching
MySuperApp.exe
will call MySuperApp.bat (the bat-file with the same name).
csc.exe
(should?) be present on every Windows machine.
ItchyItchy
Not the answer you're looking for? Browse other questions tagged .netiexpressbatch-file or ask your own question.
Bat File To Exe Converter Free Download
Active9 months ago
Following the same steps as this guide. I am trying to convert from bat to exe without installing any new software such as Bat to Exe Converter. The reason I am using this method is because all machines in my workplace already have 7zip installed and can use it, however I am not allowed to make the script work using external software not present on the main server to be compatible on any machine in the company.
I have the following TEST.bat:
and the config.txt:
then I call the following command line (in another .bat):
%PathTo7Zip%
is the directory to 7zCon.sfx%Config%
is the config.txt file above%Source7ZFile%
is my .7z archiveand %OutputFile%
is my output TEST.exe file which should supposedly run the bat file when I call it according to the author of the guide.However calling TEST.exe
triggers unzipping the .7z archive (which is expected) and then exits without running TEST.bat.
However the author explains:
Conclusion:
It is important to note that while the resulting file runs exactly the same as the source BAT file, this is not a true batch to executable conversion. The resulting file is an EXE, however it is intended to be used for self-extracting installers. When you execute the resulting EXE file, the process goes something like this:
Batch File To Exe Converter
- The contents of the EXE file are extracted to the temp directory.
- The config file generated by the script is read.
- The batch file contained in the EXE file is executed in a newcommand window.
- Once finished, the temp files are removed.
Hadi Farah
Hadi FarahHadi Farah
6662 gold badges4 silver badges15 bronze badges
1 Answer
Batch File To Exe Converter Online
Refer to this How can a .bat file be 'converted' to .exe without third party tools?
The original script accepts two arguments - the .bat file you want to convert and the target executable.
I made a little modification to accept one argument : Just the .bat file you want to convert.
So in this case, you can drag and drop your batch file over this script bat2exeIEXP.bat and it will be converted to exe file with the same name as the batch file.
Batch File To Executable Converter
HackooHackooBat File To Exe Converter Download
11.4k3 gold badges21 silver badges48 bronze badges