How do I specify that a file extension needs to be run with a switch?

3

I would like to make certain open with a specific program, but that program requires a specific switch to be provided for it to actually open it. How would I go about setting this up?

The specific case here is me trying to use the 1964 emulator, which requires the file to be opened to have a -g before hand. For example, like this: 1964.exe -g "C:\Path\To\Rom.n64". It doesn't accept 1964.exe "C:\Path\To\Rom.n64".

Pokechu22

Posted 2014-10-05T22:51:18.970

Reputation: 408

Answers

3

You can create a batch file with the specific arguments and associate the extension to it.

  1. Create a batch file in C:\temp\1964.cmd with the content:

    C:\Path\To\1964.exe -g %1

  2. Right click and *.n64, open with -> Choose default program, and pick C:\temp\1964.cmd

Dummy

Posted 2014-10-05T22:51:18.970

Reputation: 66

It's not remembering the choice... Whenever I select it, it opens fine, but then double clicking it again does nothing. (For the record, rather than having open and open with, it just as open with... -- I think it hasn't had any extensions registered and won't behave right. I've tried both .bat and .cmd) – Pokechu22 – 2014-10-05T23:30:52.650

... After setting it to open incorrectly with 1964.exe (intentionally), I was able to register it properly. Weird. I noticed that in the registry (was poking around to see if I could do stuff there), the stuff in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.n64\OpenWithList wasn't updating until I chose a .exe program, but once I did it allowed the .bat one to work fine and was updated with that as well. – Pokechu22 – 2014-10-05T23:33:31.560

Weird. I did test with *.abc and it worked.Maybe some settings mess up from before. Glad to know it worked for you :) – Dummy – 2014-10-06T00:22:20.973