7zip timestamp archive under context menu
Does anyone know how I can add a context menu item that would compress a folder and add a timestamp? So that I can right-click a folder and it would give me the option to create something like this: folder_20100528.zip
(I'm posting it here beca开发者_Go百科use I figure it's something that's done through a batch file/code)
The batch script should be reasonably simple, so create it and throw it in C:\
On XP:
- Then open explorer and click the 'Tools' -> 'Folder Options' menu.
- Select the 'File Types' tab.
- Scroll down the extensions list until you find 'File Folder', and highlight it.
- Click the 'Advanced' Button
- This will open a new window, where you can create 'actions' (eg context menu items).
- Simply make a new one, call it what you want, and set up the parameters to send into the batch file.
the batch script is what I was trying to figure out ; )
SET ZIPPATH="C:\Program Files\7-Zip\7z.exe"
SET TIMESTAMP=%date:~6,4%%date:~3,2%%date:~0,2%-%Time:~0,2%%Time:~3,2%
%ZIPPATH% a -tzip "YRH_%TIMESTAMP%" "YRH\*"
for now I'm just using a .bat file that I dropped in the directory, I'll try to implement the rest later
thanks
精彩评论