I need to open files of type .unitypackage using the command Unity.exe -openfile "%1", but if I "right-click -> open with" it only allows me to select the program, not the command line options.

What can I do to fix that on Windows 8.1?

2 Answers 2


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 -openfile switch.

  • 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:

    1. Select Settings
    2. Type associate
    3. Select Change the file type associated with a file extension
    4. Select the file extension
    5. 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:

    1. Edit → New File Extension (or Ctrl+T)
    2. Fill out the dialog to create an extension .unitypackage: Screenshot of New File Extension dialog
    3. Actions → New Action (or Ctrl+N)
    4. Fill out the dialog: Screenshot of New Action 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, not .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).

    @="Unity Package"
    @="\"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 ,3 or ,10 or something, if it doesn’t include any document icons at all, then either use ,0 or remove that part altogether.)


On Windows 7, they registy key HKEY_CLASSES_ROOT\txtfile\shell\print\command contains "%SystemRoot%\system32\NOTEPAD.EXE /p %1". If you find the key for your file type, perhaps changing it to Unity.exe -openfile %1 will work even on Windows 8.1

  • That’s not much of an answer; this is more of a um-well-try-this comment. A proper answer would include specific instructions. Consider editing to improve this post.
    – Synetech
    Nov 19, 2013 at 15:23
  • @Synetech the doing it by hand is not an issue, though it's more of an issue the "well randomly try this, maybe it works". I'll certainly try it if no one else comes up with anything more certain.
    – o0'.
    Nov 19, 2013 at 15:40
  • 1
    @Lohoris, sounds reasonable (though someone thought that the *try this and see if it applies*—and without any formatting either) was good enough to up-vote it. :-P Anyway, I threw something a little more useful together, hopefully that will do the trick.
    – Synetech
    Nov 19, 2013 at 16:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .