Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to make it so that whenever I open a particular file type (by double clicking it in explorer) it always opens the associated program with particular command line options.

So, for example, when double clicking a .tex file I want it to not only open it with emacs (which is easy to set up just by going into "Open With"), but run emacs with the command line option "-fs".

What's the easiest way to do this?


share|improve this question
up vote 4 down vote accepted

I would say that the easiest tool is Nirsoft FileTypesMan.

Launch it and find the extension you want to modify.

In the lower pane, find the action and modify it to either emacs.exe -fs %1 or emacs.exe %1 -fs

... Assuming Emacs.exe is the program name. Also, having never used it, I am not sure what order to provide the arguments. %1 is the file name, so use whichever one works.

share|improve this answer
Thanks @Wil that worked perfectly. – dbdkmezz Mar 12 '11 at 21:13
I don't have the edit permission necessary to correct it myself but I think you mean "pane", not "pain". Not trying to be a grammer nazi or anything, just trying to help. +1 – Deleted Account Mar 12 '11 at 22:11
@Spooky Action - I have the knowledge, lack the grammar skills - I never take offence! ... I do try, but look through my other answers, you will find loads more!... But, I thought anyone can edit now :S – William Hilsum Mar 12 '11 at 22:22
When I tried to edit the post it complained that my edit was too short? I wasn't sure if that's a permissions issue or just how the edit option works, either way I couldn't fix it myself. – Deleted Account Mar 13 '11 at 0:09
Ahh - I had something similar when I tried to change something on Stack Overflow... I ended up adding white space to the end in order to allow the change. Good point and I will try to open a meta question about it. – William Hilsum Mar 13 '11 at 0:11

Looking under the hood at what Nirsoft FileTypesMan does, you can do the same thing manually as follows:

  1. Look in


    at the (Default) value, for whatever file extension .ext you care about. Call that value {class_for_ext}.

  2. Look in


    at the (Default) value. That's the command line which Windows Explorer will run, and which FileTypesMan will let you edit.

share|improve this answer
thanks, was helpful.. – nawfal Jul 23 '13 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .