Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The situation is that I have a portable application that needs to have set environment variable. Other way it tries to set it's settings in user program data dir.

No not accidentally run it in non-portable mode I erased the exe extension, but then I cannot run it not only by mouse (which I want) but also through start command.

Is there any way to run such executable file that has no exe extension ?

share|improve this question
    
Your question is not really clear. If you accidentally deleted the .EXE extension, why can't you add it back? What's preventing you from doing so? –  Karan Jul 16 '13 at 1:42
    
I've deleted it on purpose to not accidentally hit it so the program would run without any parameters. I want to be safe to only run the program with options at start. –  rsk82 Jul 20 '13 at 22:20

2 Answers 2

up vote 2 down vote accepted

Yes – simply entering the program's full filename usually works. (The .exe requirement only exists in the GUI shell.)

(It might be that the file needs an extension, though – so if you can't get MyProgram to run, rename it to MyProgram.notexe or MyProgram.lol and try again.)

share|improve this answer
    
This surprised me once, when I renamed a self-extracting Zip file from .exe to .zip, tried to open it through cmd.exe, and it still ran the self-extractor instead of opening WinZip. –  grawity Jul 15 '13 at 10:37
    
I didn't know the trick with changing extension, that program might need some dummy one, thats not so intuitive. But anyway I encountered another bummer that is the application itself needs its main executable to have a strict name. –  rsk82 Jul 15 '13 at 10:44

Any file with any extension and first two bytes MZ will be treated like an EXE.

Try following:

  1. Create a new a.txt file,
  2. Type in it MZ, save it.
  3. Open cmd, go to its folder,
  4. Type a.txt and see the error message.

Replace MZ with MS and try again - this time notepad will run with file opened.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.