How to make a working exe file?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
RogerSmith
Posts: 22
Joined: 20 Nov 2012 12:42

How to make a working exe file?

#1 Post by RogerSmith » 21 Nov 2012 05:12

hey hi.

Im googling this for so many months, maybe here any one knows, how can i convert for example

Code: Select all

@echo off
echo hello dostips world
pause>nul


in to a working exe, is that possible?

Regards

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to make a working exe file?

#2 Post by foxidrive » 21 Nov 2012 05:24

Google for batch file compiler or Bat To Exe Converter , which is what one is called.

RogerSmith
Posts: 22
Joined: 20 Nov 2012 12:42

Re: How to make a working exe file?

#3 Post by RogerSmith » 21 Nov 2012 07:03

hey hi thanks for the reply

yes i have done that already, i was looking to learn how to do it myself, i dont like to use other scripts, i just know that is possible to convert .bat in to .exe, i will keep searchig. Any way Thanks for the reply. Regards

Squashman
Expert
Posts: 4483
Joined: 23 Dec 2011 13:59

Re: How to make a working exe file?

#4 Post by Squashman » 21 Nov 2012 07:45

You are not going to find any native way to do that as far as I know. Even the BAT to Exe converters are not true EXE files. They are just wrapping everything up into a self extracting executable. If you want a native binary then write your programs in a different language as a few guys on this forum already do. Aacini does some pretty cool stuff with Assembler and integrates it into his batch files.

RogerSmith
Posts: 22
Joined: 20 Nov 2012 12:42

Re: How to make a working exe file?

#5 Post by RogerSmith » 21 Nov 2012 11:02

oh i see, thanks for your reply, you may be right , im looking for so long and i cant find a way. i just saw somewere that was possible. Any way i will keep searching with not much hop
I can code a litle bit in c i have to finish read the book :P
And make my exe's
Regards

Festus Hagen
Posts: 2
Joined: 02 Dec 2012 08:00

Re: How to make a working exe file?

#6 Post by Festus Hagen » 02 Dec 2012 09:21

I can't believe I'm doing this, Created an account to someplace I'll never return to just to answer a question, Geez, I must be sick! (or in Love with this crap, Sick, Love ... They are the same!)

First off, If you are doing this for security ... Hang it up, I and any other competent hacker can easily decompile it!

Anyways, There is an Assembly program written by Doug Boling that will turn a .BAT file into a .COM.
However, it was written few days back! ;)
You can find it in: PC Magazine Volume 9, Issue 14 - August 1990
It is written in Assembly and it's called BAT2EXEC.
BAT2EXEC.asm -> BAT2EXEC.com

I do have an original copy in my old BBS's downloads section. ((the original) The Borg BBS), Sorry it's hasn't been online since 1996.
The latest release v1.5 will contain the following:
BAT2EXEC.ASM 119,990 6-25-91 8:08:18 pm
BAT2EXEC.COM 6,284 6-25-91 8:08:42 pm
BAT2EXEC.DOC 3,066 8-10-91 9:46:50 pm

I would include it here, unfortunately character count limitations prevent me from doing so, So the ASM header as a teaser instead ... :)
The ASM is nearly 4000 lines!

Code: Select all

;============================================================================
; BAT2EXEC.COM - a batch file compiler
;
; Syntax:
;       BAT2EXEC filename
;
; Revision History:
;
;       Version 1.0     Initial Release         PC Magazine Vol 9 Num 14
;
;       Version 1.1     Bug Fixes               July 19, 1990
;
;       Version 1.2     Bug Fixes               July 28, 1990
;                       Added ability to read large BAT files.
;
;       Version 1.3     PATH cmd fix.           Oct.  3, 1990
;                       Echo cmd fix
;                       Other small bug fixes.
;
;       Version 1.4     Redirection to soft     May. 12, 1991
;                       parameter bug fixed.
;
;       Version 1.5     Fixed lost label bug    June 20, 1991
;                       Parse like BAT files
;
;============================================================================


-Enjoy
fh : )_~

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: How to make a working exe file?

#7 Post by foxidrive » 02 Dec 2012 09:33

That bat2exec only works with plain/simple msdos bat files and can't handle anything complex.

It doesn't work with the NT line of batch syntax, right?

Squashman
Expert
Posts: 4483
Joined: 23 Dec 2011 13:59

Re: How to make a working exe file?

#8 Post by Squashman » 02 Dec 2012 10:03

foxidrive wrote:That bat2exec only works with plain/simple msdos bat files and can't handle anything complex.

It doesn't work with the NT line of batch syntax, right?

I believe you are correct about that.

Festus Hagen
Posts: 2
Joined: 02 Dec 2012 08:00

Re: How to make a working exe file?

#9 Post by Festus Hagen » 02 Dec 2012 11:14

Come on, It was written in 1990/1 ... That should say it all!

That was DOS5 days, so it'll handle complexity to the extent of DOS5.

However, The Assembly source is available, one can do with it as I did back in the day and increase your skills while bending it to your needs.

-Enjoy
fh : )_~

Aacini
Expert
Posts: 1909
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: How to make a working exe file?

#10 Post by Aacini » 03 Dec 2012 09:33

Ok. Here we go...

A Batch file is a text file that is processed by the Windows command-processor program cmd.exe. To execute a Batch file inside another.exe file you have two options:

1- Duplicate the functionality of cmd.exe program, that is a file 380 KB size long in Win-XP (luck with that!)

2- Use the original cmd.exe program. This way, your .exe program just works as a sort of carrier of the original Batch text (included in your .exe file) and the cmd.exe program. Most BatToExe "compilers" work this way.

I devised an additional option, here it is for you at no cost!

3- Your .exe program may work as selective interface between the original Batch text and cmd.exe. Your .exe will pass to cmd.exe via a pipe most of the commands that cmd.exe may execute in the command-line context, but your .exe program must execute by itself the few commands that don't work in command-line (like goto). Anyway, this method have also its own problems (and benefits).

Whichever you choose, this is in no way an easy task!

Antonio

RogerSmith
Posts: 22
Joined: 20 Nov 2012 12:42

Re: How to make a working exe file?

#11 Post by RogerSmith » 06 Dec 2012 19:50

Hey thanks for the replys , I can see clearly now!

Post Reply