Link to home
Start Free TrialLog in
Avatar of Tek Info
Tek Info

asked on

BAT to EXE converter for Windows 10

I am looking for a .bat to .exe converter for Windows 10
Thanks,
Avatar of Robert Retzer
Robert Retzer
Flag of Canada image

you dont really need a convert, all you need to do is rename the bat file with an exe extension, or exe to bat. then you are done no need to have an app that does that, because by time you launch the app you could have easlily renamed the file to either a bat or exe file.
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill Prew
Bill Prew

My question would be "Why?".

Most BAT to EXE conversion tools end up creating a temp BAT file when the resulting EXE is executed, so if you are trying to hide something in the BAT from anyone seeing it you will not accomplish that completely.  If someone wants to see what was in the BAT and works at it a bit they likely will be able to...


»bp
Maybe to keep out casual snoopers 🤷
The "why" question is a very good one, but since we haven't heard back from you on it, I'll take a run at this, making a few assumptions:

(1) You want the user not to see the command prompt dialog (i.e., hide it). This is doable.

(2) You want the user not to see the batch commands running. Of course, this is doable...simply put echo off in the batch file.

(3) You want the user not to be able to decrypt the EXE, thereby seeing what is in it. This is not doable...at least, not easily. However, I'll propose an easy method that will stop many/most users from being able to do the decryption, but will not stop an expert, who will be able to run a tool that decrypts the EXE.

The solution that I'm proposing is a very simple AutoHotkey script that is compiled into a stand-alone EXE with the AutoHotkey compiler, as I discuss in this EE article:
AutoHotkey - Getting Started

Here's the AutoHotkey script:

BatchFile:=A_Temp . "\DestBatchFileName.bat" ; destination - name it whatever you want and put it wherever you want on user's computer - A_Temp is the Windows temp folder
FileInstall,c:\temp\SourceBatchFileName.bat,%BatchFile%,1 ; install your batch file on user's computer
RunWait,%BatchFile%,,Hide ; run batch file, hiding command prompt window, and wait for it to finish
FileDelete,%BatchFile% ; delete batch file after it runs - this is a permanent delete, i.e., it does not go to the recycle bin (the FileRecycle command does that)
ExitApp

Open in new window

I hope that my comments on the code make it easy to understand. Also, the documentation on all the commands at the AutoHotkey site is very good.

Keep in mind that the AutoHotkey "compiler" is not a compiler in the normal sense, i.e., it does not create object code from your script. Rather, it packages the AutoHotkey interpreter along with your script's source code into an EXE file. Therefore, in order to make it difficult to see the source code, you should use either MPRESS or UPX encryption when compiling, both of which are natively supported by the AutoHotkey compiler...simply put mpress.exe or upx.exe in the Compiler subfolder after installing AutoHotkey (otherwise, you can see the source code by loading the EXE into any text editor). This is what I meant by stopping many/most users from being able to do the decryption, but not an expert, who will likely be able to figure out how to decrypt it.

Also, there are other "holes" in this method, such as the user stopping the script's execution before it has a chance to delete the batch file, but that's unlikely, unless your batch file runs for a long time, in which case it becomes a very likely possibility. In any event, perhaps this approach will be good enough for your purpose...whatever that purpose is. :)

Regards, Joe
Avatar of Tek Info

ASKER

@Robert R
Thanks for the simple solution, however Windows 10 is not allowing me to run this file.
This solution seems to create an exe from a bat, however for some reason because my script is calling on another bat file on my desktop, it seems to be looking for the other bat file..

Users\me\AppData\Local\Temp\IXP000.TMP …

So although this seems to start to work it cannot complete..

Part solution...

> ...my script is calling on another bat file on my desktop, it seems to be looking for the other bat file.. 


Trying to follow what's calling what...Can you be specific?


Myscript.bat calls desktop\another.bat, calls...