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.

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?

Thanks

share|improve this question

2 Answers 2

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
1  
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

    HKEY_CLASSES_ROOT\.ext
    

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

  2. Look in

    HKEY_CLASSES_ROOT\{class_for_ext}\shell\open\command
    

    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

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.