This question seems dumb, but I can't find the answer: how do I create a new archive with 7zip?
I know about the context menu commands, some of which perform operations which involve creating an archive, but that's not what I'm looking for. I'm looking for an operation that simply creates a new archive with a specified name in a specified location, and does nothing else.
In a standard Windows application I'd do this with File>New, but 7zip has no File>New command. I've looked in all of the menus, the help, and several tutorials, but I can't find a substitute. Where is it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The simplest way I can find is this:
1. Navigate to the folder in which you want the archive.
2. Create a new compressed folder [right click, select New, select Compressed (zipped) Folder]
3. Rename the new folder, including the ".zip" extension to whatever you want the archive to be called and with a ".7z" extension, for example "test.7z". When asked if you are sure you want to change the extension, click Yes.
4. You now have a new, empty 7zip archive in the right place.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please excuse the long delayed reply; the site never notified me that anyone had responded to my question.
I want to be sure that my question was clearly stated, because Igor's reply is so surprising that I don't see how it could be correct.
I'm asking how to create a new archive with 7-Zip. I'm referring to the standard function of any Windows application's File > New command.
ssbssa: I'll try your fix if the response to this question indicates that it's necessary and appropriate. In general, though, editing the registry requires a degree of technical savvy, and always carries a degree of risk. It is not an appropriate solution to a problem as basic as this one.
An analogy would be answering the question "How do I check the oil on my new car?" by referring to a procedure that involves disassembling the engine. It implies that something is very wrong with the design of the car (or the application), or (more likely) that the question was simply misunderstood.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
to create a new archive with 7zip:
Open 7zip program
Navigate to the file you want to archive within the 7zip window.
Right click on the file, hover over 7zip, then select "Add to Archive"
This will open a new window where you can name the archive file, select archive type, and make other adjustments. Once you have all the settings where you want them, click "OK" at the bottom of the window.
New archive created.
I do agree that the "Help" file should at least have basic "how to:" instructions such as this included in it for those that have never used 7zip before. As it is, the help file contains very little "help" - it is all specs, with no instruction.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is really lame. Probably 99% of Windows programs implement the standard right-click - New context menu. Why not this one???
To ssbssa: I tried your instructions but it only created an empty ShellNew key under .7z and didn't create the Data value until I removed the backslash from the string of numbers. However, removing the backslash still failed to create a right-click New entry for 7zip. Maybe I entered in something wrong? This is what I did:
Right-clicked on Desktop - New - Text Document.
Copied and pasted the following.
Saved the text file.
Held down Shift key, right-clicked on the Desktop, and chose "Open command window here".
ren [filename].txt [filename].reg
Exited the command console, hit F2, and renamed the REG file to "Add 7z to right-click New menu".
Double-clicked on the REG file and allowed the change to the Registry.
Verified the addition under .7z in the Registry's HKCR section.
I notice that the Data value says REG_BINARY but the REG file says "Data"=hex. Is this the expected result? If not, how do you change the value to hex? Are you supposed to create a DWORD or QWORD instead?
To experiment, I also tried:
Creating strings such as NullFile, ItemName, and Filename under the ShellNew key pointing to a blank 7zip file that I created, named 7z.7z, and copied to C:\Windows.
Copying the exact subkeys, strings, and so on from HKCR's .zip key and trying to use them for .7z.
These experiments didn't work either. Dreadfully, 7zip is still exceedingly annoying to work with on account of this lack of basic functionality.
After days of experimenting, I finally figured out to add 7zip to Windows 7's right-click New menu. I'm using Windows 7 Professional x64. If you're using another version of Windows, this may or may not work for you.
Instructions:
Back up your Registry or take a system snapshot just in case you mess something up.
If, at some time in the past, you already right-clicked on a 7zip file, clicked Properties, clicked on Change next to Open With, selected 7zip, and checked the box for "Always use the selected program to open this kind of file", or if, at some point, you right-clicked and chose Open With – Choose Default Program – 7zip, you might need to undo that action. The reason is because the User Choice overrides the normal file extension actions (including, I think, the ability to add 7zip to the right-click New menu). If so, open the Registry and search for 7zFM.exe in the Open With list. Delete this key, resetting your 7zip back to a pristine state. Hit F5 to Refresh the Desktop and confirm that when you double-click on a 7zip file, Windows doesn't know what program you want to use.
Use Notepad or your favorite text editor to create a simple text document containing a few words.
Using 7zip, add this simple textfile into a new 7zip file and save to the Desktop as 7z.7z. In my case, my resulting 7z.7z file was about 220 bytes.
Re-open 7z.7z and delete the text file so that now, the 7z file is empty. The reason for steps 3 to 5 is so that the file will have the proper binary format for opening with 7z. If you simply create a random empty text file and change the extension from .txt to .7z, or a zero-byte .7z file, the file probably won't open with 7zip.
Right-click on the altered 7z.7z, choose Properties, and confirm that it is now fewer bytes than the original. In my case, my empty 7z.7z was 32 bytes. Those 32 bytes probably contain the code that 7zip needs to be able to open the file.
Confirm that 7z.7z still opens properly in 7zip.
Copy 7z.7z to your Windows folder. You can copy the file somewhere else if you prefer, but you will need to change the subsequent instructions accordingly. Just make sure to copy it somewhere that is safe from meddling and accidental deletion.
Open the Registry Editor (Start – Run – regedit) and scroll down to HKEY_CLASSES_ROOT.7z.
Right-click on the .7z key and Export to the Desktop, so that you can go back to original settings if necessary.
In the right-hand pane of .7z, change the (Default) value to 7z_auto_file. I chose this name because Windows 7 automatically creates a key with this name when you right-click a .7z file and choose to open with 7zip. You could probably use another name if you changed the subsequent instructions accordingly.
Right-click on the .7z key and choose New Key. Name the key ShellNew.
Click on the ShellNew key.
In the right-hand pane of ShellNew, right-click and create a new String Value named FileName.
Double-click on the FileName string and change the value to C:\Windows\7z.7z. Note that if you try to use %SystemRoot% here, the resulting 7zip file from a right-click New menu probably won't open properly or at all. When I used %SystemRoot%\7z.7z, my 7zip file was 0 bytes and refused to open. So I changed the path back to C:\Windows\7z.7z. I think this might have something to do with ShellNew requiring a "fully-qualified name" also known as a fully-qualified file path.
Right-click on HKEY_CLASSES_ROOT and create a New Key called 7z_auto_file.
In the Registry Editor, click on Favorites – Add to Favorites to create Favorites for HKCR .7z and HKCR 7z_auto_file, so that you can return to each one quickly with a couple of mouse clicks.
Go to HKEY_CLASSES_ROOT\7z_auto_file.
Change the (Default) value to Compressed (7zipped) Folder.
Right-click on the 7z_auto_file key and create a New Key called DefaultIcon.
Right-click on the 7z_auto_file key again and create another New Key called shell.
Click on the DefaultIcon key.
In the right-hand pane, change the (Default) value to point to your favorite 7zip icon. You can download miscellaneous 7zip icons online. I used one named 7z_blue_icon.ico that is 72 x 72 pixels and displays 7z on a blue and white background. I copied my ICO file to Windows and set the value to C:\Windows\7z_blue_icon.ico,0. Be sure to include the comma zero after the file path.
Go to the shell key that you created a few minutes ago.
Right-click on shell and create a New Key called Open.
Right-click on Open and create a New Key called Command.
Click on Command. In the right-hand pane, change the (Default) value to point to 7Zip's File Manager (not its GUI), with %1 to indicate that 7zFM should open a file. Put both components in double quotation marks to accomodate any long filenames. For me, the value was "C:\Program Files\7-Zip\7zFM.exe" "%1".
Hit F5 within Registry Editor and on the Windows Desktop to refresh Explorer. You shouldn't need to reboot.
Try the right-click context menu on the Desktop. You may have to try twice or wait about 5 seconds before you see any change. You should ultimately see a new entry, New – Compressed (7zipped) Folder.
Create the new 7zip file and confirm that the file opens properly when double-clicked. Confirm that you can add files to the 7zip compressed file and can save the edited file.
If everything works as expected, go back to Registry Editor and Export the keys for .7z and for 7z_auto_file so that you can Import them in the future; when you reinstall Windows, for example. Note that in the exported reg files, the Windows folder is enclosed in double backslashes for some reason: C:\Windows\7z.7z.
To edit the exported reg files, right-click and choose Edit.
If the instructions didn't work for you, seek support from an expert or write an email to Mr. Igor Pavlov requesting that he please add 7zip to the standard right-click New menu in Windows.
Good luck.
E.M.
PS - If you are running Windows inside of a virtual machine as I am (in Parallels on a MacBook Pro), be sure that your 7zip Registry file paths remain entirely within the virtual machine and do not point to the Mac OS X file system or any networked disks. In other words, keep it simple. Point to files and folders on the virtualized C: drive which is actually within your PVM file if you are using Parallels.
Firstly great work on identifying the registry entries Erik Maher
I hate to dig up an old thread, but i need to set the record straight for others that find this thread as i did. Erik Maher's registry method above is not correct for 7zip build 16.04 (current at time of writing) on windows 10 and i suspect this is the same on other windows OS versions such as 7 and 8.
It's worth noting that i only tested this on 64 bit windows 10 pro with the 64 bit version of 7zip.
Still using steps 3 to 8 on creating the empty 7z.7z archive from Erik Maher's post/comment.
I found that the correct registry settings were as follows (my .reg file).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\7-Zip.7z]
; this entry is the name that apears in the conext menu you may desire a different one
@="7z Archive"
[HKEY_CLASSES_ROOT\7-Zip.7z\DefaultIcon]
; this is where you would change the file path for a non default icon
@="C:\Program Files\7-Zip\7z.dll,0"
PS - i found i could also substitute the .7z extension with the .zip extension in the reg file above to use traditional zips aswell, just REMEMBER to create a blank 7z.zip file like we did with the 7z.7z file
Last edit: Sibliss 2018-06-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Reading other peoples comments, it seems this application requires too
much futzing. And the encryption does not work (at least for me).
There should be a "right click -> new -> 7-Zip archive" operation,
like most other installed applications do.
Right clicking a file does give you a "7-Zip -> Add to file.Zip"
option, but this does not ask you if you want to encrypt it. What you
want to do is "right click -> 7-Zip -> Add to archive..." which then
gives you the option to enter a password.
However this password appears to be useless, because when you perform
"right click -> 7-Zip -> Open archive", it opens it without asking for
the password. Thinking that the password was cached (which would be a
bad idea, security wise), I did a reboot but with the same result: it
does not prompt you for a password to gain access.
Also "Add to archive" is not a "Move to archive" function: When you
"Add to archive" the original is still there, and you have to delete
the original as a separate step ("Add to archive" should really be
called "Copy to archive")
Also, the .7z file extension is not properly associated with the 7-Zip
application, so a double click on a .7z file does not launch 7-Zip,
instead some window briefly flashes on the screen (so quickly that you
can not see what it is).
I uninstalled it.
Last edit: EarlOlsen 2023-08-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This question seems dumb, but I can't find the answer: how do I create a new archive with 7zip?
I know about the context menu commands, some of which perform operations which involve creating an archive, but that's not what I'm looking for. I'm looking for an operation that simply creates a new archive with a specified name in a specified location, and does nothing else.
In a standard Windows application I'd do this with File>New, but 7zip has no File>New command. I've looked in all of the menus, the help, and several tutorials, but I can't find a substitute. Where is it?
The simplest way I can find is this:
1. Navigate to the folder in which you want the archive.
2. Create a new compressed folder [right click, select New, select Compressed (zipped) Folder]
3. Rename the new folder, including the ".zip" extension to whatever you want the archive to be called and with a ".7z" extension, for example "test.7z". When asked if you are sure you want to change the extension, click Yes.
4. You now have a new, empty 7zip archive in the right place.
7-Zip doesn't support that feature.
If you add the following registry file you can create an empty 7z-archive with the explorer:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.7z\ShellNew]
"Data"=hex:37,7a,bc,af,27,1c,00,03,8d,9b,d5,0f,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00
Please excuse the long delayed reply; the site never notified me that anyone had responded to my question.
I want to be sure that my question was clearly stated, because Igor's reply is so surprising that I don't see how it could be correct.
I'm asking how to create a new archive with 7-Zip. I'm referring to the standard function of any Windows application's File > New command.
ssbssa: I'll try your fix if the response to this question indicates that it's necessary and appropriate. In general, though, editing the registry requires a degree of technical savvy, and always carries a degree of risk. It is not an appropriate solution to a problem as basic as this one.
An analogy would be answering the question "How do I check the oil on my new car?" by referring to a procedure that involves disassembling the engine. It implies that something is very wrong with the design of the car (or the application), or (more likely) that the question was simply misunderstood.
to create a new archive with 7zip:
Open 7zip program
Navigate to the file you want to archive within the 7zip window.
Right click on the file, hover over 7zip, then select "Add to Archive"
This will open a new window where you can name the archive file, select archive type, and make other adjustments. Once you have all the settings where you want them, click "OK" at the bottom of the window.
New archive created.
I do agree that the "Help" file should at least have basic "how to:" instructions such as this included in it for those that have never used 7zip before. As it is, the help file contains very little "help" - it is all specs, with no instruction.
This is really lame. Probably 99% of Windows programs implement the standard right-click - New context menu. Why not this one???
To ssbssa: I tried your instructions but it only created an empty ShellNew key under .7z and didn't create the Data value until I removed the backslash from the string of numbers. However, removing the backslash still failed to create a right-click New entry for 7zip. Maybe I entered in something wrong? This is what I did:
Right-clicked on Desktop - New - Text Document.
Copied and pasted the following.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT.7z\ShellNew]
"Data"=hex:37,7a,bc,af,27,1c,00,03,8d,9b,d5,0f,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
Saved the text file.
Held down Shift key, right-clicked on the Desktop, and chose "Open command window here".
ren [filename].txt [filename].reg
Exited the command console, hit F2, and renamed the REG file to "Add 7z to right-click New menu".
Double-clicked on the REG file and allowed the change to the Registry.
Verified the addition under .7z in the Registry's HKCR section.
I notice that the Data value says REG_BINARY but the REG file says "Data"=hex. Is this the expected result? If not, how do you change the value to hex? Are you supposed to create a DWORD or QWORD instead?
To experiment, I also tried:
Creating strings such as NullFile, ItemName, and Filename under the ShellNew key pointing to a blank 7zip file that I created, named 7z.7z, and copied to C:\Windows.
Copying the exact subkeys, strings, and so on from HKCR's .zip key and trying to use them for .7z.
These experiments didn't work either. Dreadfully, 7zip is still exceedingly annoying to work with on account of this lack of basic functionality.
After days of experimenting, I finally figured out to add 7zip to Windows 7's right-click New menu. I'm using Windows 7 Professional x64. If you're using another version of Windows, this may or may not work for you.
Instructions:
Back up your Registry or take a system snapshot just in case you mess something up.
If, at some time in the past, you already right-clicked on a 7zip file, clicked Properties, clicked on Change next to Open With, selected 7zip, and checked the box for "Always use the selected program to open this kind of file", or if, at some point, you right-clicked and chose Open With – Choose Default Program – 7zip, you might need to undo that action. The reason is because the User Choice overrides the normal file extension actions (including, I think, the ability to add 7zip to the right-click New menu). If so, open the Registry and search for 7zFM.exe in the Open With list. Delete this key, resetting your 7zip back to a pristine state. Hit F5 to Refresh the Desktop and confirm that when you double-click on a 7zip file, Windows doesn't know what program you want to use.
Use Notepad or your favorite text editor to create a simple text document containing a few words.
Using 7zip, add this simple textfile into a new 7zip file and save to the Desktop as 7z.7z. In my case, my resulting 7z.7z file was about 220 bytes.
Re-open 7z.7z and delete the text file so that now, the 7z file is empty. The reason for steps 3 to 5 is so that the file will have the proper binary format for opening with 7z. If you simply create a random empty text file and change the extension from .txt to .7z, or a zero-byte .7z file, the file probably won't open with 7zip.
Right-click on the altered 7z.7z, choose Properties, and confirm that it is now fewer bytes than the original. In my case, my empty 7z.7z was 32 bytes. Those 32 bytes probably contain the code that 7zip needs to be able to open the file.
Confirm that 7z.7z still opens properly in 7zip.
Copy 7z.7z to your Windows folder. You can copy the file somewhere else if you prefer, but you will need to change the subsequent instructions accordingly. Just make sure to copy it somewhere that is safe from meddling and accidental deletion.
Open the Registry Editor (Start – Run – regedit) and scroll down to HKEY_CLASSES_ROOT.7z.
Right-click on the .7z key and Export to the Desktop, so that you can go back to original settings if necessary.
In the right-hand pane of .7z, change the (Default) value to 7z_auto_file. I chose this name because Windows 7 automatically creates a key with this name when you right-click a .7z file and choose to open with 7zip. You could probably use another name if you changed the subsequent instructions accordingly.
Right-click on the .7z key and choose New Key. Name the key ShellNew.
Click on the ShellNew key.
In the right-hand pane of ShellNew, right-click and create a new String Value named FileName.
Double-click on the FileName string and change the value to C:\Windows\7z.7z. Note that if you try to use %SystemRoot% here, the resulting 7zip file from a right-click New menu probably won't open properly or at all. When I used %SystemRoot%\7z.7z, my 7zip file was 0 bytes and refused to open. So I changed the path back to C:\Windows\7z.7z. I think this might have something to do with ShellNew requiring a "fully-qualified name" also known as a fully-qualified file path.
Right-click on HKEY_CLASSES_ROOT and create a New Key called 7z_auto_file.
In the Registry Editor, click on Favorites – Add to Favorites to create Favorites for HKCR .7z and HKCR 7z_auto_file, so that you can return to each one quickly with a couple of mouse clicks.
Go to HKEY_CLASSES_ROOT\7z_auto_file.
Change the (Default) value to Compressed (7zipped) Folder.
Right-click on the 7z_auto_file key and create a New Key called DefaultIcon.
Right-click on the 7z_auto_file key again and create another New Key called shell.
Click on the DefaultIcon key.
In the right-hand pane, change the (Default) value to point to your favorite 7zip icon. You can download miscellaneous 7zip icons online. I used one named 7z_blue_icon.ico that is 72 x 72 pixels and displays 7z on a blue and white background. I copied my ICO file to Windows and set the value to C:\Windows\7z_blue_icon.ico,0. Be sure to include the comma zero after the file path.
Go to the shell key that you created a few minutes ago.
Right-click on shell and create a New Key called Open.
Right-click on Open and create a New Key called Command.
Click on Command. In the right-hand pane, change the (Default) value to point to 7Zip's File Manager (not its GUI), with %1 to indicate that 7zFM should open a file. Put both components in double quotation marks to accomodate any long filenames. For me, the value was "C:\Program Files\7-Zip\7zFM.exe" "%1".
Hit F5 within Registry Editor and on the Windows Desktop to refresh Explorer. You shouldn't need to reboot.
Try the right-click context menu on the Desktop. You may have to try twice or wait about 5 seconds before you see any change. You should ultimately see a new entry, New – Compressed (7zipped) Folder.
Create the new 7zip file and confirm that the file opens properly when double-clicked. Confirm that you can add files to the 7zip compressed file and can save the edited file.
If everything works as expected, go back to Registry Editor and Export the keys for .7z and for 7z_auto_file so that you can Import them in the future; when you reinstall Windows, for example. Note that in the exported reg files, the Windows folder is enclosed in double backslashes for some reason: C:\Windows\7z.7z.
To edit the exported reg files, right-click and choose Edit.
If the instructions didn't work for you, seek support from an expert or write an email to Mr. Igor Pavlov requesting that he please add 7zip to the standard right-click New menu in Windows.
Good luck.
E.M.
PS - If you are running Windows inside of a virtual machine as I am (in Parallels on a MacBook Pro), be sure that your 7zip Registry file paths remain entirely within the virtual machine and do not point to the Mac OS X file system or any networked disks. In other words, keep it simple. Point to files and folders on the virtualized C: drive which is actually within your PVM file if you are using Parallels.
Firstly great work on identifying the registry entries Erik Maher
I hate to dig up an old thread, but i need to set the record straight for others that find this thread as i did. Erik Maher's registry method above is not correct for 7zip build 16.04 (current at time of writing) on windows 10 and i suspect this is the same on other windows OS versions such as 7 and 8.
It's worth noting that i only tested this on 64 bit windows 10 pro with the 64 bit version of 7zip.
Still using steps 3 to 8 on creating the empty 7z.7z archive from Erik Maher's post/comment.
I found that the correct registry settings were as follows (my .reg file).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\7-Zip.7z]
; this entry is the name that apears in the conext menu you may desire a different one
@="7z Archive"
[HKEY_CLASSES_ROOT\7-Zip.7z\DefaultIcon]
; this is where you would change the file path for a non default icon
@="C:\Program Files\7-Zip\7z.dll,0"
[HKEY_CLASSES_ROOT\7-Zip.7z\Shell]
@="open"
[HKEY_CLASSES_ROOT\7-Zip.7z\Shell\open]
@=""
[HKEY_CLASSES_ROOT\7-Zip.7z\Shell\open\command]
@="\"C:\Program Files\7-Zip\7zFM.exe" "%1""
[HKEY_CLASSES_ROOT.7z]
@="7-Zip.7z"
[HKEY_CLASSES_ROOT.7z\ShellNew]
"FileName"="C:\Windows\7z.7z"
PS - i found i could also substitute the .7z extension with the .zip extension in the reg file above to use traditional zips aswell, just REMEMBER to create a blank 7z.zip file like we did with the 7z.7z file
Last edit: Sibliss 2018-06-24
Reading other peoples comments, it seems this application requires too
much futzing. And the encryption does not work (at least for me).
There should be a "right click -> new -> 7-Zip archive" operation,
like most other installed applications do.
Right clicking a file does give you a "7-Zip -> Add to file.Zip"
option, but this does not ask you if you want to encrypt it. What you
want to do is "right click -> 7-Zip -> Add to archive..." which then
gives you the option to enter a password.
However this password appears to be useless, because when you perform
"right click -> 7-Zip -> Open archive", it opens it without asking for
the password. Thinking that the password was cached (which would be a
bad idea, security wise), I did a reboot but with the same result: it
does not prompt you for a password to gain access.
Also "Add to archive" is not a "Move to archive" function: When you
"Add to archive" the original is still there, and you have to delete
the original as a separate step ("Add to archive" should really be
called "Copy to archive")
Also, the .7z file extension is not properly associated with the 7-Zip
application, so a double click on a .7z file does not launch 7-Zip,
instead some window briefly flashes on the screen (so quickly that you
can not see what it is).
I uninstalled it.
Last edit: EarlOlsen 2023-08-26