How do you register the 7-Zip GUI program with the .7z extension in Windows?

For whatever reason, the 64-bit Windows Installer doesn't seem to register the .7z file extension with the 7-Zip GUI (or with anything, as far as I can tell).

How do I go about doing it. A simple "open with"(7zG.exe) doesn't work, because 7-Zip apparently requires a command-line that doesn't fit the usual pattern for the shell invoking programs. I can't seem to divine what this syntax might be from the command line (/? -? --help all give 'invalid syntax' errors).

How do I set it up so that clicking on a .7z file opens the GUI?


Solution 1:

You can do this from within the program itself. Simply launch the 7-Zip File Manager as Administrator (this is important), and then click on the Tools menu and select Options. Here you can set your file associations for many types, not just the .7z extension.

Solution 2:

Looks like I gave up searching too soon.

The executable you want to associate .7z files with is the 7zFM.exe, not 7zG.exe. Doing that through "Open With" works as expected.

You can also do so from within the FileManager application by going to Tools > Options and selecting the formats there (this may only work if the app is run with admin privileges, though?).

Solution 3:

You can also do this sort of thing from the command line using the commands ftype and assoc. The first sets up a type of file and the program used to deal with them. The second command can then be used to associate multiple extensions with the file type and hence the executable.

For example, to find out the settings on your machine for zip files:

ftype | findstr zip
assoc | findstr zip

To learn more about the commands you can do this:

help ftype
help assoc