Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

*.bat to *.exe?

35 views
Skip to first unread message

Chua Wen Ching

unread,
Nov 8, 2002, 3:58:22 PM11/8/02
to
1 question. How to convert *.bat to *.exe? Can it be done
in windows 2000/XP? Thank you.

From,
Chua Wen Ching

Oli Restorick

unread,
Nov 8, 2002, 5:33:44 PM11/8/02
to
I am guessing that what you're trying to say is that you have some existing
batch files and you want them to behave as execuatable files, without
flashing up a command interpreter window.

I think I can safely say that it's not possible to turn them into executable
files, but Joe at www.joeware.com has a utility that will launch an
executable file silently.

Why don't you tell us what you're trying to achieve and then we can make
some better suggestions?

Regards

Oli

"Chua Wen Ching" <wenc...@wenching.com> wrote in message
news:a3ae01c28769$92a57cf0$37ef2ecf@TKMSFTNGXA13...

Chris Thomas

unread,
Nov 8, 2002, 5:58:04 PM11/8/02
to
There is a utility I've seen on the Internet, not sure
where now, but it lets you compile a batch file into
an .exe file.

>.
>

Marty List

unread,
Nov 8, 2002, 6:08:44 PM11/8/02
to

Actually it is possible, there are several utilities written to do this. I
haven't used them in years, since the DOS 5.0 time frame.

I still have one of these programs called TurboBat.exe in my toolbox. The
file is dated 1993 but it appears to work somewhat in Windows 2000, but only
with some basic commands. For example, it didn't like Attrib for some
reason.

I have no idea how well they will work under NT, but it looks like they're
still around:

TurboBAT: Compiles DOS batch file to .COM file
http://www.hyperware.com/pub/xdos/tbt501s.zip
http://www.simtel.net/pub/pd/40684.html

bat2ex15.zip Converts BAT files to EXE files:
http://www.simtel.net/pub/pd/40551.html

PowerBatch: Compiles batch-like files to EXE
http://www.simtel.net/pub/pd/40651.html

"Oli Restorick" <use...@willowhayes.co.uk> wrote in message
news:ea1Sbd3hCHA.2240@tkmsftngp12...

Torgeir Bakken (MVP)

unread,
Nov 8, 2002, 6:25:29 PM11/8/02
to
Oli Restorick wrote:

> I am guessing that what you're trying to say is that you have some existing
> batch files and you want them to behave as execuatable files, without
> flashing up a command interpreter window.
>
> I think I can safely say that it's not possible to turn them into executable
> files, but Joe at www.joeware.com has a utility that will launch an
> executable file silently.

BAT2COM/EXE:

http://ihide.virtualave.net/download/download.html

http://www.subnetonline.com/download/download.html

http://nlsn.free.fr/batch-down/Bat2Exe.ZIP


COM2EXE & EXE2COM converter
http://www.programmersheaven.com/zone5/cat22/3105.htm


--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway


Oli Restorick

unread,
Nov 8, 2002, 7:35:02 PM11/8/02
to
Looks like I was wrong, then. I'm having a bad day today.

"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3DCC47E9...@hydro.com...

Ritchie

unread,
Nov 9, 2002, 7:55:04 AM11/9/02
to
"Oli Restorick" <use...@willowhayes.co.uk> wrote in message news:#wUXNh4hCHA.1572@tkmsftngp09...

> Looks like I was wrong, then. I'm having a bad day today.

Oli, until someone can demonstrate a bat to exe/com converter
that not only works but also 'knows' about the batch language
extensions in CMD.EXE, consider yourself _CORRECT_.

I suspect the absence of such a util is that anyone skillful
enough to create such a program knows that to do so would be
pointless - someone will always manage to break it. I challenge
anyone to write a converter that couldn't be broken by single a
line of code.

Chua,
Say why you want a converter, and I bet someone suggests a
better alternative, whether its for reasons of performance,
obfuscation, protection of intellectual rights or something
else.

My two cents,
--
Ritchie
Undo address for mail


Chua Wen Ching

unread,
Nov 10, 2002, 11:39:02 AM11/10/02
to
Hmm...why i need a converter anyway?
I just want to place it in my registry - run rather than
in the c:\documents....\startup folder?

I think *.bat cannot run in registry - run so that is why
i need a *.exe?

Will it affect performance??

I also try running the QUIET program...it is not working.
it still display the command prompt.

Thank you.

Regards,
Chua Wen Ching :D

Chua Wen Ching

unread,
Nov 10, 2002, 11:42:07 AM11/10/02
to
Hmm...bat2exe is not working as i expected. Why? Any
limitations?

script.bat
xcopy c:\haha\k\*.* c:\UBS

so simple but when i run bat2exe script.bat
it say script.bat not found...funny....?
i placed it in the same folder!

Thank you

Shenan T. Stanley

unread,
Nov 10, 2002, 12:14:36 PM11/10/02
to
haha
So instead of tringto run a *.bat from the registry - you want to convert it
to .exe?

HKLM\Software\Microsoft\Windows\CurrentVersion\Run

Put whatevcer you want to run there.

--
Shenan

Torgeir Bakken (MVP)

unread,
Nov 10, 2002, 12:10:21 PM11/10/02
to
Chua Wen Ching wrote:

> Hmm...why i need a converter anyway?
> I just want to place it in my registry - run rather than
> in the c:\documents....\startup folder?
>
> I think *.bat cannot run in registry - run so that is why
> i need a *.exe?

Batch files run perfectly well from Run, this ones runs flawlessly on my Win2k
computer:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"tst"="c:\\tst.bat"


> Will it affect performance??
>
> I also try running the QUIET program...it is not working.
> it still display the command prompt.

That is because QUIET.EXE in itself creates a command window :(


If you want to hide the command prompt, do like this instead:

Start it from a vbscript (the batch file to run could also be a input parameter
to the vbscript):

wscript.exe <path to vbscript>

The line above can be placed in Run in registry.


Then use this vbscript:

Set oShell = CreateObject ("Wscript.Shell")

' the extra "" is to support spaces
sCmd = """c:\some dir\ my bat.bat"""

' The 0 will make it run hidden
oShell.Run sCmd, 0, False


If you want the vbscript to wait for the batch file to finish before continuing,
change "False" to "True".

Gary Smith

unread,
Nov 11, 2002, 1:39:22 AM11/11/02
to
Chua Wen Ching <wenc...@wenching.com> wrote:
> Hmm...bat2exe is not working as i expected. Why? Any
> limitations?

BAT2EXE never worked very well, even on the version of DOS (5.0, I think)
for which it was designed. It would be most surprising to find it doing
an adequate job on any non-trivial Windows batch file. I played with it a
bit when it was first released and quickly abandoned it as useless.

--
Gary L. Smith g...@infinet.com
Columbus, Ohio

Al Dunbar

unread,
Nov 13, 2002, 1:15:49 PM11/13/02
to

"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3DCE92FD...@hydro.com...

Of course, the unspoken caveat is that the .bat file should not require user
input...

/Al

Al Dunbar

unread,
Nov 13, 2002, 1:32:36 PM11/13/02
to

"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3DCE92FD...@hydro.com...

Below is a slightly more general version of Torgeir's script that accepts
batch file names from the command-line. Could be run with:

wscript.exe <path to vbscript> <path to first batch> <path to second
batch>

or by drag-n-dropping a series of batch-files onto the vbscript file.

/Al

runwait = false
showWhenDone = false

Set oShell = CreateObject ("Wscript.Shell")

Set objArgs = WScript.Arguments

if objArgs.Count = 0 then

msgbox "drag a batch file here"

else

for each arg in objargs
oShell.Run """" & arg & """", 0, runwait
if showwhendone then
msgbox arg & vbnewline & vbnewline & "done"
end if
next

end if

0 new messages