Difference between "exe" and "com" files?
Results 1 to 10 of 10

Thread: Difference between "exe" and "com" files?

  1. #1
    Registered User
    Join Date
    Feb 2001
    Location
    Vancouver, B.C., Canada
    Posts
    83

    Post Difference between "exe" and "com" files?

    Since this eruption of Sircam virus has kept us quite busy we had to do a little tweaking in the registry.

    Since the virus infects the registry commmand that executes programs with the "exe" exetension you have to rename the regedit program to .com.

    My question is, why does this work? Is there a difference between exe and com?

    I tried this will other programs just for kicks and it seems to work.

    It worked great since I removed the virus and couldn't open iexplore. So I renamed it to *.com and it worked.

    So WDG's(windriver guros) whats the difference?

    .JL.
    He who can laugh at himself will never cease to be amused.

  2. #2
    Registered User
    Join Date
    May 2001
    Location
    New Orleans
    Posts
    290

    Post

    Not much difference now, but long, long ago, when windows was still in the pre-3.0 stage, the difference in extensions was a way to distinguish DOS files from Windows files.
    Community standards do not maintain themselves: They're
    maintained by people actively applying them, visibly, in public. - Eric Raymond

  3. #3
    Registered User
    Join Date
    Mar 2001
    Location
    Waukesha, WI
    Posts
    28

    Post

    Originally posted by Ron Prestenback:
    <STRONG>Not much difference now, but long, long ago, when windows was still in the pre-3.0 stage, the difference in extensions was a way to distinguish DOS files from Windows files.</STRONG>

    Actually it goes back even further, com stood for Compiled, in DOS it was compiled code that would run "with" dos, where-as an exe ran on top of dos.
    Mike Palecek, MCP
    Production Manager

  4. #4
    Intel Mod Platypus's Avatar
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    5,783

    Post

    Mmm, actually it goes even further back than that....

    DOS was originally written with some backward compatability with CP/M, and its .COM designation comes from there. CP/M came with an absolutely minimal core (being designed for machines of 64k or less) with few internal commands. Other necessary commands like COPY were coded in executable files like DOS's XCOPY.COM etc

    As they were external COMmands, the files were .COM files and had to be a memory image under 64k in size. This was continued in DOS. COM files must have less than 64k of code, data and stack space, the stack is automatically established downward from the top of the 64k block.

    An .EXE file can be any size and has a header containing information for the DOS EXEC function to position the re-locatable code that EXE's are compiled and linked to, any data structures the program requires and a stack of the correct size.

    It doesn't actually matter whether the file is called .COM or .EXE, as it is examined to determine its type before it is run. Some files are already mis-named, eg Win9x COMMAND.COM is an .EXE, as is EDIT.COM

    Swapping them around is an old trick to confuse viruses.

  5. #5
    Registered User kingtbone's Avatar
    Join Date
    May 2001
    Location
    Freddy Beach
    Posts
    794

    Post

    To be honest, it really goes back even farther than that...

    When the stone-age began, (just kidding)

    I think this one got traced back as far as it's going to go. <IMG SRC="smilies/biggrin.gif" border="0"> <IMG SRC="smilies/biggrin.gif" border="0">
    Hard work often pays off in the long run, but Lazyness always pays off now.

  6. #6
    Intel Mod Platypus's Avatar
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    5,783

    Post

    <IMG SRC="smilies/biggrin.gif" border="0">

  7. #7
    Registered User
    Join Date
    Feb 2000
    Location
    Tolland, Ct.
    Posts
    60

    Post

    Files with extensions .com, .exe, and .bat are all executable. If more than one file has the same name with one of the above extensions, they will be executed in that order. I.E, if you have Command.com and Command.exe and you type in Command at the DOS prompt, it will search for Command.com and execute it. If there is no Command.com, it will look for Command.exe and then Command.bat and execute the first available file. Obviously, if you add the extension at the DOS prompt, it will execute that specific file. Windows probably uses the same sequence when booting.

  8. #8
    Registered User
    Join Date
    Aug 1999
    Location
    near the backdoor to hell
    Posts
    804

    Post

    Originally posted by timgottier:
    <STRONG>Files with extensions .com, .exe, and .bat are all executable. If more than one file has the same name with one of the above extensions, they will be executed in that order. I.E, if you have Command.com and Command.exe and you type in Command at the DOS prompt, it will search for Command.com and execute it. If there is no Command.com, it will look for Command.exe and then Command.bat and execute the first available file. Obviously, if you add the extension at the DOS prompt, it will execute that specific file. Windows probably uses the same sequence when booting.</STRONG>
    actually, a bat file is not executable, just recognized as a BATch of command/executable statements.

  9. #9
    Registered User
    Join Date
    May 2001
    Location
    New Orleans
    Posts
    290

    Post

    ROTFLMAO

    This has gotten ridiculous.. <IMG SRC="smilies/wink.gif" border="0">

    This is like a game of Spades where everyone keeps trumping the hand prior...keep it up guys...I needed a good laugh right now..
    Community standards do not maintain themselves: They're
    maintained by people actively applying them, visibly, in public. - Eric Raymond

  10. #10
    Registered User
    Join Date
    May 2001
    Location
    New Orleans
    Posts
    290

    Post

    ROTFLMAO

    This has gotten ridiculous.. <IMG SRC="smilies/wink.gif" border="0">

    This is like a game of Spades where everyone keeps trumping the hand prior...keep it up guys...I needed a good laugh right now..
    Community standards do not maintain themselves: They're
    maintained by people actively applying them, visibly, in public. - Eric Raymond

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •