[comp.windows.ms] Converting COM to EXE

climan@clamen.avalon.cs.cmu.edu (Dani Climan) (09/12/90)

Is there a utility that will convert COM files to EXE so that they
can run based on their input files extension.  For example, I would
like to run a PAGE.COM when I click on a .txt file.  Any suggestions
would be appreciated.

Dani Climan
climan@clamen.avalon.cs.cmu.edu

otto@tukki.jyu.fi (Otto J. Makela) (09/12/90)

(following-up, since this might be of interest to larger circles...)

In article <10446@pt.cs.cmu.edu> climan@clamen.avalon.cs.cmu.edu (Dani Climan) writes:
   Is there a utility that will convert COM files to EXE so that they
   can run based on their input files extension.  For example, I would
   like to run a PAGE.COM when I click on a .txt file.  Any suggestions
   would be appreciated.

I'm not familiar with the extension mechanism used in Windows, but there is
a very nice utility package called LZEXE (current version 0.92, I believe)
which includes a utility to convert COM file to EXE files.  The main function
of the utility package is to LZW-compress executable files and tack on a
small (under 500 bytes) auto-extractor program -- a bit like viruses do :-)
It doesn't work with overlayed programs (I'm not sure about Windows progs).

Of course, if you just need a EXE extension to the filename, you can simply
rename the file.  I believe DOS versions since 3.10 can figure out the actual
type of the file from the EXE file header (or the non-existance of one), thus
running it the "right" way.
--
* * * Otto J. Makela <otto@jyu.fi> * * * * * * * * * * * * * * * * * * * * *
* Phone: +358 41 613 847, BBS: +358 41 211 562 (CCITT, Bell 2400/1200/300) *
* Mail: Kauppakatu 1 B 18, SF-40100 Jyvaskyla, Finland, EUROPE             *
* * * Computers Rule 01001111 01001011 * * * * * * * * * * * * * * * * * * *

rb9a@watt.acc.Virginia.EDU (Raul Baragiola) (09/12/90)

In article <10446@pt.cs.cmu.edu> climan@clamen.avalon.cs.cmu.edu (Dani Climan) writes:
>Is there a utility that will convert COM files to EXE so that they
>can run based on their input files extension.  For example, I would
>like to run a PAGE.COM when I click on a .txt file.  Any suggestions
>would be appreciated.
>

The utility is copy: copy filename.com filename.exe. This should work
if I understood you correctly.


Raul A. Baragiola                               \Internet: raul@virginia.edu
Dept. Nuclear Engnr. and Engnr. Physics          \Phone: (804)-982-2907
University of Virginia, Charlottesville, VA 22901 \ Fax: (804)-924-6270

jls@hsv3.UUCP (James Seidman) (09/12/90)

In article <10446@pt.cs.cmu.edu> climan@clamen.avalon.cs.cmu.edu (Dani Climan) writes:
>Is there a utility that will convert COM files to EXE so that they
>can run based on their input files extension.  For example, I would
>like to run a PAGE.COM when I click on a .txt file.  Any suggestions
>would be appreciated.

Well, I always thought (though I haven't tried it) that you *could*
associate to COM files.  However, I know for a fact that you can
associate to PIF files, so try this: just use the PIF editor to make
a PIF which runs PAGE.COM.  The from the File Manager associate .TXT
to that PIF.  Should work fine...

-- 
Jim Seidman (Drax), the accidental engineer.
"There's a certain freedom to being completely screwed." - The Freshman
UUCP: ames!vsi1!headland!jls
ARPA: jls%headland.UUCP@ames.nasa.arc.gov

bcw@rti.rti.org (Bruce Wright) (09/13/90)

In article <1990Sep12.112646.16097@murdoch.acc.Virginia.EDU>, rb9a@watt.acc.Virginia.EDU (Raul Baragiola) writes:
> In article <10446@pt.cs.cmu.edu> climan@clamen.avalon.cs.cmu.edu (Dani Climan) writes:
> >Is there a utility that will convert COM files to EXE so that they
> >can run based on their input files extension.  For example, I would
> >like to run a PAGE.COM when I click on a .txt file.  Any suggestions
> >would be appreciated.
> 
> The utility is copy: copy filename.com filename.exe. This should work
> if I understood you correctly.

Since DOS can tell from the file contents whether the file is
organized as a .COM or a .EXE file, Raul is correct that this 
should work for the problem in Windows.

But if (as sounds possible) Raul is claiming that this will
convert the .COM to a real .EXE file, that just isn't true:
the .EXE file has additional information that is missing from
the .COM file and a simple copy won't hack it.

It shouldn't be difficult to convert a .COM to a .EXE, though
apart from this problem with Windows I'm not exactly sure why
you'd want to;  there are no big advantages that you gain 
since you still wouldn't have the program running in anything 
more than 64K or able to run in protected memory.

					Bruce C. Wright

jmerrill@jarthur.Claremont.EDU (Jason Merrill) (09/15/90)

In article <10446@pt.cs.cmu.edu> climan@clamen.avalon.cs.cmu.edu (Dani Climan) writes:
>Is there a utility that will convert COM files to EXE so that they
>can run based on their input files extension.  For example, I would
>like to run a PAGE.COM when I click on a .txt file.  Any suggestions
>would be appreciated.

No need; just rename the file.  DOS (and Windows, I imagine) will properly
determine what sort of program it is and run it properly.  Alternately, get
COMTOEXE.EXE from the LZEXE 0.91 distribution, available at all finer FTP
sites.

-- 
--
Jason Merrill				jmerrill@jarthur.claremont.edu