Problems with .bat, .com, .exe and bat2exe

leeroyMarv

New Member
I want to know, if anyone could help, what the problem is with this program bat2exe. I believe it's suppossed to turn the batch file into an executable but when i attempt it i get: cannot find input file. Could someone give me instuctions on what to do. And also i can create batch files fine but when i create a .com file with the same text it doesn't work. Does it have to be written in another programming language or something?
 
coms are different that bats. To run bat2exe you probably need to run it at the command line. ie. c:\> bat2exe batname.bat

batch.asm is the assembly code for bat2exe
 
Last edited:
Still having problems

Could someone please explain to me why the bat2exec program keeps coming up with the message: "can't find input file." This is in the dos prompt after typing 'the directoy of bat2exec, then batch2exe, then the directory of the bat file.' I now even have the asw file in the same folder and its still not working. "Can't find input file." Does anyone know how to fix this problem?
 
Using absolute paths:
C:\> C:\folder\bat2exe C:\folder\batch.bat
Relative paths may be necessary:
C:\> cd\folder
C:\folder> bat2exe batch.bat
 
Having seen your many posts on Dos I think I should point out that a little knowledge can be a dangerous thing. Dos may be out of date but it can still mess things up very well.

Re bat2exe. I don't know if you are aware, but com, bat and exe are all executable files. You don't need to convert a bat file to exe to run it. For example (in XP), copy the line below into Notepad and save somewhere as calc.bat . Double-click and it will start the Windows calculator. Earlier versions of Windows will have different path to calc.exe .

start c:\windows\system32\calc

The purpose of converting a bat file to exe is to hide its contents. Not many legitimate or necessary reasons for doing that these days.

Starman*
 
Last edited:
What do you mean by a little knowledge, are you saying as in i might accidentaly wreck one of the neccessary windows apps or something by using dos when i dont know that much about it. Yes i am aware that bats coms and exes are all executables but bats aren't as fast or reliable and they can be edited by others, so i would prefer an exe. I dont know that much about coms though except that they are some sort of command file and that the MS-DOS command prompt is one of them.
 
I don't use bat files much these days but I never found them slow or unreliable. In the old days autoexec.bat was the mainstay of the pc. For most people the editability of a bat file is more of a plus than a minus.

Re dangers of using Dos, it's not a forgiving program. You say and it does. In most cases it doesn't ask "are you sure?" In another post you asked about debug. If you have code that needs debug to resolve you must have something fairly complicated or you have some syntax errors you cannot figure out.

You seem to heading towards other people using your exe files "...and they can be edited by others". The fact you've posted this thread to figure out bat2exe is not reassuring.

Starman*
 
I tried converting a bat file and it worked, sort of. Basic syntax per Cromewell last post. It's easiest if bat2exe and your bat file are in the same folder. When I tried it I got a .com file which would not work if tried as-is or if renamed to exe. It briefly opened the command line window but then did nothing.

Converting a bat file does not always work - depends on commands in bat file.

Starman*
 
It would take me more time then I care to put into it to find out what exactly will work (no offense, but going through that much assembly code that wasn't written by me is a pain, not to mention making sure it all works as advertised) but Starman is right, not all batch commands can be compiled with that program
 
I don't think it handles FOR properly. Also your batch file can't have a long file name (8 characters + .bat)
 
I also wondered if Command Line is really identical to Dos. That bat2exe program was written in 1990. There are payware progs for doing the job. Might be interesting to get a trial version. At worst their Help may be useful.

Starman*
 
Thanks for the help it finally worked but only made a .com file. Why is the program called 'bat2exe' then, how can i make an exe using it, and can i make a ghost app using it?
 
FYI I tried Quick Batch File Compiler (trial payware) and it worked fine. The trial version displays a notification screen when it runs the compiled exe, then the exe runs. Seems fair enough for trial version. Probably only worth getting if you're doing a bunch or going into business.

Starman*
 
Old thread but as I've found it looking for similar information I thought I'd answer this old question as it's fairly simple.

You run bat2exe from the command line to convert the relevant file to an exe once you have navigated to the folder within dos i.e.

C:\Program Files\bat converter>bat2exe yourfile.bat

The bat2exe program and the bat file you want to convert must be in the same folder (bat converter in this case). Anything else will give you the error you are seeing.

Be aware that there seems to be a problem with long file paths for moving files (which is what I am trying to do) anyone who knows anything on this please let me know!
 
Be aware that there seems to be a problem with long file paths for moving files (which is what I am trying to do) anyone who knows anything on this please let me know!
In 1990 (according to Starman, that's when bat2exe was written, I haven't checked the program), long paths didn't exist. You had 8.3 naming standards (8 character name . 3 character extension). If you want it to work on the command line use the old legacy names. i.e. cd\Progra~1\batcon~1\bat2exe ....
 
Back
Top