Default executable file extension?

By Vigilante ยท 8 replies
Oct 27, 2005
  1. Came across an interresting issue today.

    You know how normally when you type a file name such as "regedit" it will open "regedit.exe".
    Or "cmd" opens "cmd.exe" or "notepad" opens "notepad.exe".

    Well what do you suppose it means when you type a name but it adds ".com" instead? So if you click start-run and type "regedit", it tries to open "" instead of EXE.
    Note that you can type the full filename regedit.exe or whatever, and it opens fine, but the default extension turns to .COM somehow. Not sure what that means.

    So how do you tell Windows to look for EXE instead of COM when typing a filename?
  2. RealBlackStuff

    RealBlackStuff TS Rookie Posts: 6,503

    If there are files with both .com and .exe, by default Windows will first try the .com version.
    Some trojans and other ilk 'drop' a .com version for an existing .exe program, thus effectively stopping the .exe from functionning when called without extension.

    .com programs are generally smaller as well, and could call up their big .exe brother, so it's a bit of hit and miss.
    When in doubt, Google both versions.
  3. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    Check the PATHEXT variable - it lists the extensions that are tried when executing a file.
  4. Vigilante

    Vigilante TechSpot Paladin Topic Starter Posts: 1,666

    Still no luck, neither of those two turned up anything.

    Any other ideas? Thx
  5. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    You are saying that the PATHEXT variable contains absolutely nothing?
  6. Samstoned

    Samstoned TechSpot Paladin Posts: 1,018

  7. Vigilante

    Vigilante TechSpot Paladin Topic Starter Posts: 1,666

    Actually the PATHEXT var contains a whole string of characters, starting with *.COM;.EXE..... I don't remember off hand. We matched it up to a couple other XP machines, it's all the same.

    As for the virus option, I can't say for sure. The PC is clean, but not sure if there was something that could have damaged something.
    However, there is no error messages when a file is ran. All EXE files run fine, either by double-clicking or by typing the extension explicitly like "regedit.exe".
    If you leave the extension off, it defaults to trying to use COM instead. Very weird.

    I will have him repair the EXE file extension just the same. I've got a script that does it.
  8. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    PATHEXT should not start with a *. It should go .com;.exe... listing all the "executable" extensions that will be tried in the order listed.

    Just tested.. If you put * before .com it will break running .exe files without extension.
    So fix your PATHEXT.
  9. Vigilante

    Vigilante TechSpot Paladin Topic Starter Posts: 1,666

    Interresting. I also noticed the * as well. I believe I had him try it both ways. I will find out tomorrow what happened. But that sounds like it, although he never said that fixed it without the asterisk. I'll let you know.

Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...