I have a program that opens with a specific shortcut, but the shortcut seems to send parameters to the application. If I go directly to the target directory and double-click, it does not work. However, if I use the command line and pass in a certain argument, the application opens correctly.

I want to open certain file types using the application, but the application must have the parameters, or it will not work. Is it possible to do this sort of thing?

link|improve this question

Which version of Windows are you using? – iglvzx Nov 27 '11 at 3:43
I am using Windows 7. – Josh Nov 28 '11 at 23:44
feedback

2 Answers

up vote 2 down vote accepted

You can do this with assoc and ftype at the command prompt. Open an elevated command prompt and try the following:

ftype MyFileType=C:\MyDir\MyProgram.exe /arg1 /arg2 "%1"
assoc .xyz=MyFileType

This will associate the .xyz extension with MyProgram.exe and will pass the command line /arg1 /arg2 [filename.xyz] to the program to run it.

link|improve this answer
Accepted because this seems to be the right answer from what I have researched. However, this process seems ineffectual on the system I'm using. I can use ftype and assoc to verify that the changes went through, but it does not affect the program used to open files. Maybe the process has changed in Windows 7? – Josh Jan 4 at 3:08
feedback

Here is an extension that seems to do exactly what you want. I've never used it before, but it seems to get good reviews. leave a comment if there are issues.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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