Computer Hope

Microsoft => Microsoft DOS => Topic started by: hibyy on January 25, 2009, 06:23:03 AM

Title: Error with bat2exe.com
Post by: hibyy on January 25, 2009, 06:23:03 AM
I need help I found out how to use the bat2exe.com It turns bats to .com files but only if there title is 4 letters long... But what I reall need help with is when my .bat is a .com it doesn't do what I told it to do as a .bat can someone help me?
Title: Re: Error with bat2exe.com
Post by: Dias de verano on January 25, 2009, 06:29:32 AM
these programs are a bad idea. My advice is to not use them.

Since you do not post details of your batch file, nobody will be able to help you.
Title: Re: Error with bat2exe.com
Post by: hibyy on January 25, 2009, 06:39:42 AM
Well I was Trying to convert this code

Code:
@echo off
:B
Title Bat to Com Converter
echo Please type in the name of the .bat file you wish to convert.
set /p A=
echo starting Converter...
bat2exe %A%.bat
echo.
set /p E=To countinue presss ENTER.
cls
goto B

And I downloaded this file from this site why is it a bad idea?
Title: Re: Error with bat2exe.com
Post by: Dias de verano on January 25, 2009, 06:47:58 AM
That bat2exe.com program is for MS-DOS and your batch file contains set /p which is not used in MS-DOS.

I think those programs are a bad idea because they don't work very well, and because batch files were never meant to be made into compiled programs.
Title: Re: Error with bat2exe.com
Post by: hibyy on January 25, 2009, 06:49:42 AM
Oh Well thanks for the help! I'll see If I can try to learn .com programing so I won't have to use a converter!
Title: Re: Error with bat2exe.com
Post by: BC_Programmer on January 25, 2009, 09:24:35 AM
Oh Well thanks for the help! I'll see If I can try to learn .com programing so I won't have to use a converter!

COM programming will likely require assembly knowledge. (Although it might be possible in C) it's the same as a DOS executable, sans the header, and it can only be 64K.
Title: Re: Error with bat2exe.com
Post by: BatchFileCommand on January 25, 2009, 01:16:34 PM
Quote
because batch files were never meant to be made into compiled programs.

I beg to differ. I think that it would be very hard to share programs that people could very easily edit and call there own. Or here's (http://www.brothersoft.com/bat-to-exe-converter-download-50301.html) my favorite batch converter. It converts it too .exe, but when you convert it you have the option of adding additional information and you can choose an icon file! 
Title: Re: Error with bat2exe.com
Post by: Dias de verano on January 25, 2009, 01:22:29 PM
I beg to differ. I think that it would be very hard to share programs that people could very easily edit and call there own.

It's not hard. I do it all the time!

"Meant" means "intended". Microsoft did not intend that batch files should be compiled.
Title: Re: Error with bat2exe.com
Post by: BatchFileCommand on January 25, 2009, 02:14:22 PM
Then why did they put a built-in batch file converter in windows xp. It's called iexpress....
Title: Re: Error with bat2exe.com
Post by: fireballs on January 25, 2009, 02:17:58 PM
BFC you're not going to win this argument, basically because you're wrong. But kudos on trying to up your post count.

FB
Title: Re: Error with bat2exe.com
Post by: Dias de verano on January 25, 2009, 03:13:04 PM
BFC you're not going to win this argument, basically because you're wrong. But kudos on trying to up your post count.

FB

Regarding iexpress, he has got a point there, actually. It's more like a wrapper than a converter, but then so are the converters.
Title: Re: Error with bat2exe.com
Post by: BC_Programmer on January 26, 2009, 09:22:27 AM
the only "real" way to "compile" a batch program would be to convert it into another language completely and compile the result.

The best of these would be a conversion to assembly.

The Iexpress program is included with Windows XP. Batch Programs have been around since DOS (version 2, I believe, not sure if Version 1 had them); as such one can only conclude that since a "wrapper" type program was not introduced officially by the "language vendor" until over 25 years after the original introduction that it was not intended, as Dias has already said, to be compiled.


I find this IExpress tool humourous, simply because it uses the same Font for titles that the wizards in Office 4 use. LOL.
Title: Re: Error with bat2exe.com
Post by: nothlit on January 26, 2009, 10:22:21 AM
here's (http://www.brothersoft.com/bat-to-exe-converter-download-50301.html) my favorite batch converter. It converts it too .exe, but when you convert it you have the option of adding additional information and you can choose an icon file! 

You might just have become my hero, I have wanted a batch to exe for awhile ... awesome
Title: Re: Error with bat2exe.com
Post by: BC_Programmer on January 26, 2009, 10:31:52 AM
it's not a compiler. It's a wrapper, just like all the others.


Warranted, it was a bit harder to find the batch code using process explorer- I had to find strings in memory rather then in the image, and it wasn't at the very end of the file.

However- the very existence of the original batch code in the supposedly "compiled" executable means it wasn't actually "compiled" but rather... somehow, performs interpretation at run-time of the batch code.


As such- compiling a batch file with tools such as this one, while very useful for distribution, is completely useless for either speed, or obfuscation.



EDIT:

never mind. It's actually less advanced then I originally suspected. analyzing the in memory strings with Process explorer, revealed an odd entity:

"C:\Docume~1\mburgwin\LOCALS~1\Temp\81C.tmp\b2e.dll"


curious as to this file, I navigated to this location and TYPEd it, thinking perhaps it was the batch file itself. No nice. However, looking at the other files in the directory, I discovered an interesting file- echo2.bat, which just so happened to be an exact duplicate of my originally compiled batch program! EGADS!
Title: Re: Error with bat2exe.com
Post by: BatchFileCommand on January 26, 2009, 06:37:25 PM
It's not a wrapper. It turned my batch file code to a bunch of funky symbols letters and stuff.  BC, have you ever used this program? I'm afraid it doesn't convert stuff over 35kb.
Title: Re: Error with bat2exe.com
Post by: BC_Programmer on January 27, 2009, 04:27:09 AM
It's not a wrapper. It turned my batch file code to a bunch of funky symbols letters and stuff.  BC, have you ever used this program? I'm afraid it doesn't convert stuff over 35kb.

Yes. that is what I describe above.
Title: Re: Error with bat2exe.com
Post by: BatchFileCommand on January 27, 2009, 06:19:55 AM
All I want it to do is make my code unreadable and have it still run. Here's a chunk of code from my program:

Code: [Select]
„+€1Ø3
>„߃Mìÿ àü'h
Pðk] f9;„t


That's definatley exe
Title: Re: Error with bat2exe.com
Post by: BC_Programmer on January 27, 2009, 06:40:10 AM
All I want it to do is make my code unreadable and have it still run. Here's a chunk of code from my program:

Code: [Select]
„+€1Ø3
>„߃Mìÿ àü'h
Pðk] f9;„t


That's definatley exe


Sigh. Did you read the post? do you know what process explorer is?

The batch file is plain text in the memory image.
Title: Re: Error with bat2exe.com
Post by: Dias de verano on January 27, 2009, 10:48:55 AM

Sigh. Did you read the post? do you know what process explorer is?

The batch file is plain text in the memory image.

BC_programmer, can't you see you're talking to an expert? Just look at the technical language he uses...

Quote
a bunch of funky symbols letters and stuff.
Title: Re: Error with bat2exe.com
Post by: BatchFileCommand on January 27, 2009, 03:35:38 PM
Code: [Select]
BC_programmer, can't you see you're talking to an expert? Just look at the technical language he uses...

I love you sense of humor...
Title: Re: Error with bat2exe.com
Post by: BC_Programmer on January 27, 2009, 07:12:52 PM
All I want it to do is make my code unreadable and have it still run. Here's a chunk of code from my program:

Code: [Select]
„+€1Ø3
>„߃Mìÿ àü'h
Pðk] f9;„t


That's definatley exe

HA HA! I found a hole it that logic too! where's the MZ?