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:
ECHO This is a Test bat to exe
pause
and the config.txt:
;!@Install@!UTF-8!
RunProgram="TEST.bat"
;!@InstallEnd@!
then I call the following command line (in another .bat):
COPY /B "%PathTo7Zip%\7zCon.sfx" + %Config% + %Source7ZFile% %OutputFile%
%PathTo7Zip%
is the directory to 7zCon.sfx
%Config%
is the config.txt file above
%Source7ZFile%
is my .7z archive
and %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:
- 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 new command window.
- Once finished, the temp files are removed.
pause
is not working and I cannot see the output. So I addedmkdir not_a_real_dir
to my bat file and even then no new folder has been added. The bat file is simply not executing and maybe someone knows why. – Crocidolite