There are a few different options to set a file association in Windows 8. Unfortunately, the built-in methods tend not to support any fancy like custom command-line arguments.
You can right-click a file and select Open With, then Choose Default Program to browse for the program. You will likely need to manually edit the registry to add the
You can set file associations with the Set Default Programs app; again you will need to manually modify the registry to include the switch.
If you go this route, then you can do it as follows:
- Select Settings
- Select Change the file type associated with a file extension
- Select the file extension
- Click the
[Change Program] button
Note, you may not see the file extension in the list if you have not previously tried to open the file (for example with the previous method).
Use a third-party program like FileTypesMan to create a file association. With FileTypesMan, you could do it as so:
- Edit → New File Extension (or Ctrl+T)
- Fill out the dialog to create an extension
- Actions → New Action (or Ctrl+N)
- Fill out the dialog:
Manually create the registry entries for the association. I’ve taken the liberty of whipping one up for you. Just copy it to a plain-text file, make sure to save it with an extension of
.reg.txt (you can do this by selecting
All Files (*.*) in the file-type drop-down in the Save As dialog). Then run the saved registry script and accept to merge it. You can use hard-coded paths (which you can edit if needed in the text-editor) or use variables by uncommenting the specified lines (you would need to edit those in Regedit since they are encoded as hexadecimal).
@="\"C:\\Program Files (x86)\\Unity\\Editor\\Unity.exe\",1"
; Uncomment the line below by removing the leading semi-colon to use an environment variable ("%ProgramFiles(x86)%\Unity\Editor\Unity.exe",1) instead of the hard-coded path above.
@="\"C:\\Program Files (x86)\\Unity\\Editor\\Unity.exe\" -openfile \"%1\""
; Uncomment the line below by removing the leading semi-colon to use an environment variable ("%ProgramFiles(x86)%\Unity\Editor\Unity.exe") instead of the hard-coded path above.
(Note: I do not have Unity installed on my current machine, so I cannot check the icons included in the binary, so you may need to change the
,1 in the DefaultIcon settings in the registry script and dialogs to something more appropriate like
,10 or something, if it doesn’t include any document icons at all, then either use
,0 or remove that part altogether.)