Windows 7 – Adding Default Command Line Options for Filetypes

windows 7

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

Best Answer

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.