How to run a file as executable with a different extension?

3

After taking a look at the listed processes in Window's TaskManager, I've noticed that there are some process that has a different extension other than .exe. I then opened the folder location of one of those processes and their extension is the same as they are shown in TaskManager. So, I was wondering how they do it. I just wanted to learn how its done.

I've tried renaming my application with a different extension and it didn't run.

Why am I seeking answers to this question? For security purposes.

Macro

Posted 2013-05-08T04:04:32.023

Reputation:

Out of curiosity, why do you want to do this? The .exe extension is specifically there to mark executable files. – templatetypedef – 2013-05-08T04:05:55.167

1Seconding @templatetypedef. This is suspicious as hell, LOL. – Maggy May – 2013-05-08T04:06:26.863

What code are you using to run it with? Is it reporting any errors, and if so which? – None – 2013-05-08T04:06:28.410

Are you creating Example.exe by compiling c++ file? – None – 2013-05-08T04:08:45.177

Yeah. But I've seen processes in Windows taskmanager with a different extension other than .exe. So, I was wondering how they do it. – None – 2013-05-08T04:09:50.493

Why would you want to confuse your users? If you're trying to hide an executable file, there are far better techniques. Someone is bound to find your executable. – templatetypedef – 2013-05-08T04:14:02.380

Well one reason is because, sometime debuggers expect all process to end with ".exe". So, yes I am trying to defend my application against debuggers and other malicious tools. I've know other functions can help but I was curious about this one technique. – None – 2013-05-08T04:15:49.857

I think the reason for the downvotes is that the specific question you're asking (how do I run a non-exe?) isn't really the main question you want answered (how do I prevent someone from debugging or tampering with my program?) You might want to ask that latter question here to see if you can get any input or advice. – templatetypedef – 2013-05-08T04:21:22.117

4Do you have any examples? I just started Task Manager and I couldn't see anything but .exe files listed. – Mark Ransom – 2013-05-08T04:21:56.927

Answers

4

Indirectly, the command line "start foo.abc" will run an executable renamed from foo.exe.

More directly, edit the registry. In HKEY_CLASSES_ROOT, create a new Key with the name .abc. and set the default value to abcfile.

Under abcfile, make key, name it Shell, and under that, create a new key named open, and under that, create another key named command. Now copy the contents from exefile and copy the contents over. You may want to search for other instances if ".exe" in the registry to find the appropriate contents, as they seem to change from across Windows versions.

This all of course assumes you have administrator access, because you would of course not do this on any system but your own. :)

Charles Burns

Posted 2013-05-08T04:04:32.023

Reputation: 735

-1

open up cmd prompt type: start pathOfFile\file.pdf /c vshost.exe

this will run your file with pdf extension as .exe or any other you wanna give

don't misuse it, think someone helped you out, before harming any one

anonymous

Posted 2013-05-08T04:04:32.023

Reputation: 1

What are you talking about in your last paragraph? – Scott – 2018-05-24T05:26:44.427