Default executable file extension?

Status
Not open for further replies.

Vigilante

Posts: 1,634   +0
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 "regedit.com" 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?
 
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.
 
Check the PATHEXT variable - it lists the extensions that are tried when executing a file.
 
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.
 
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.
 
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.

cheers
 
Status
Not open for further replies.
Back