How To Create MS-DOS Application (.COM Files)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nitt
Posts: 218
Joined: 22 Apr 2011 02:43

How To Create MS-DOS Application (.COM Files)

#1 Post by nitt » 06 May 2011 22:54

I thought this would be helpful to you guys, so I made this brief tutorial. You will not find this method on Google, because I came up with it myself.

This is a brief tutorial on how to create and code MS-DOS applications, or .COM files.

First, you must write the program. To do this, you want to write a .BAT file in Batch, and code it how you want the COM file to work.

Second, you have to code an SED file. This is what tells the computer how to compile the .BAT file.

"TagetName" must end in ".COM".
"AppLaunched" must have "cmd /c " and end with the Batch file's name.
"FILE0" must be equal to the bat file.
"SourceFiles" must be equal to the path of both the SED and bat file.

Here is an example code below:

Code: Select all

[Version]
class=iexpress
sedversion=3
[Options]
hideextractanimation=1
TargetName=%TargetName%
AppLaunched=%AppLaunched%
PostInstallCmd=%PostInstallCmd%
SourceFiles=SourceFiles
[Strings]
TargetName=Application.com
AppLaunched=cmd /c 1.bat
PostInstallCmd=<None>
FILE0="1.bat"
[SourceFiles]
SourceFiles0=C:\Users\nitt\desktop\
[SourceFiles0]
%FILE0%=


Thirdly, load up CMD. Now navigate to the location of both of the files. Type in "iexpress /n " followed by the SED file's name. Such as "iexpress /n test.sed".

Press enter and done! You have created a .COM file! :3

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How To Create MS-DOS Application (.COM Files)

#2 Post by aGerman » 07 May 2011 15:30

Sorry, nitt, but your topic is wrong.

IExpress.exe will create a self extracting archive, but the resulting file is not a real .com file (16-Bit-Application). It's an .exe file (32-Bit-Application) with a wrong file extension. That's all :(

BTW: If you want to create a real .com application you could use debug.exe with Assembly code. Here you can find an example.

Regards
aGerman

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: How To Create MS-DOS Application (.COM Files)

#3 Post by nitt » 07 May 2011 15:55

aGerman wrote:Sorry, nitt, but your topic is wrong.

IExpress.exe will create a self extracting archive, but the resulting file is not a real .com file (16-Bit-Application). It's an .exe file (32-Bit-Application) with a wrong file extension. That's all :(

BTW: If you want to create a real .com application you could use debug.exe with Assembly code. Here you can find an example.

Regards
aGerman


Well, the problem is most computers today don't have debug.exe (meaning you are using an outdated computer).

And this also isn't an EXE with the wrong extensions, it's a CAB with the wrong extension. CAB files can be EXE's, COM's, or PIF's. It's just .COM files can be any file that can be read as a 16bit application. And this can, so technically, it is.

And renaming the extension doesn't make it a false file. Like this is a PNG, even though it has a GIF format:

Image

So, ya. Like, no one has DEBUG.EXE anymore. And I know how IExpress works, I was just hoping know one else would.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How To Create MS-DOS Application (.COM Files)

#4 Post by aGerman » 07 May 2011 16:17

Well, I have debug.exe on my Win7 machine. It's not a question of an outdated computer but whether you're working on a 32 Bit or a 64 Bit OS.
A 64 Bit OS cannot execute real 16 Bit .com files. For that reason debug.exe is senseless.

BTW: If you change the extension name it makes a false file, but a lot of programs are "intelligent" enough to notice that (because of the file header that you could check in a HEX editor).

Regards
aGerman

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: How To Create MS-DOS Application (.COM Files)

#5 Post by nitt » 07 May 2011 16:24

aGerman wrote:Well, I have debug.exe on my Win7 machine. It's not a question of an outdated computer but whether you're working on a 32 Bit or a 64 Bit OS.
A 64 Bit OS cannot execute real 16 Bit .com files. For that reason debug.exe is senseless.

BTW: If you change the extension name it makes a false file, but a lot of programs are "intelligent" enough to notice that (because of the file header that you could check in a HEX editor).

Regards
aGerman


How could I get debug.exe on my 64bit?
Also, 32bit systems are actually outdated systems. They have stopped being mass produced because:
-Of the major error that was found (PM me if you want me to explain that)
-64bit are better

You can still buy 32bit operating systems, but in a generation you will rarely see any.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How To Create MS-DOS Application (.COM Files)

#6 Post by aGerman » 07 May 2011 17:36

nitt wrote:How could I get debug.exe on my 64bit?

No idea. But if you would have it not sure if you could get it run on your 64 Bit OS.


nitt wrote:Also, 32bit systems are actually outdated systems. They have stopped being mass produced because:
-Of the major error that was found (PM me if you want me to explain that)
-64bit are better

I have never heard something about a "major error", but you're right that 64 Bit are better because of a better hardware exploitation that makes it faster. I think the main reason why 32 Bit computers are still produced is compatibility.


nitt wrote:You can still buy 32bit operating systems, but in a generation you will rarely see any.

I agree, but in a generation (or maybe half a year) your brand new 64 Bit computer is outdated as well. So what ... :wink:

How ever, nitt, we are far away from batch themes now. From my side I will end up at this point.

Regards
aGerman

Post Reply