How to add a Windows Explorer context menu item with custom functionality?

Solution 1:

7-zip is open source so I suppose you could implement this feature yourself (tee hee) or petition/pay the core developers to do it for you. In lieu of that:

You can't do it by configuring 7-zip options, but you can do it by making a new context menu item. The text won't be dynamic like your mockup, but the results will be the same.

Basically what you're going to need to do is create a batch script that launches 7-zip with the right parameters to take the file you specify and add it to an archive, supplying today's date as the file name.

This script will do that (based on the script from here). Paste this into a new text file called 7ztoday.bat:

@echo off
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B

"%programfiles%\7-zip\7z.exe" a %mm%%dd%%yyyy%.7z %1

Then, using a utility such as Default Programs Editor, we can add a new context menu item for files that points at this batch script. For convenience, I exported this change as a reg file, so you can just copy this into a new text file ending with .reg and double click to merge into the registry.

Windows Registry Editor Version 5.00

; Created with Default Programs Editor 
; http://defaultprogramseditor.com/

; Add Verb
[HKEY_CURRENT_USER\Software\Classes\*\shell\AddToTodaysArchive_verb_key]
@="Add file to today's archive"
[HKEY_CURRENT_USER\Software\Classes\*\shell\AddToTodaysArchive_verb_key\command]
@="\"C:\\Users\\Public\\7ztoday.bat\" \"%1\""

Regarding 7-zip settings:

That particular sub menu is registered by 7-zip, and you can configure what appears on the submenu from that program's options, by opening the 7-Zip File Manager and going to Tools -> Options -> Plugins, select "7-Zip", then click Options. On the list in that window is all the built in options that are available for that secondary list in the context menu.

enter image description here