7z file manager (7zFM.exe) can be launched via context menu.
This conveniently produces the 7z GUI already prepared for archiving. All I need to do is change the archive name and maybe add a password.
This is possible. But just how can it be achieved via command line?
My searches on the Web and in the Registry were fruitless. I even wonder how there can be a 7z context menu entry if there appears to be no such thing in the Registry.
My goal is to significantly ease my multiple daily backup tasks, where I create archives with an incrementing archive name counter (e.g. "0004") for multiple projects (DTP and such). I would do this via batch files and/or a little Java program I'd make to derive the appropriate archive name (See counter.) to be prepared in the GUI, if such a detail can be defined via command line.
1 Answer
If everything was easy like this. - The Task Manager's "Details" tab gives it away. The syntax is:
"C:\Program Files\7-Zip\7zG.exe" a -ad -saa -- "D:\eula.2052.txt
I left out the -i#7zMap7448:36:7zEvent28001 part because apparently that refers to the immediate user action that could somehow be evaluated by the program, but the command line start doesn't have such action, so the error in the screenshot appears.
Also in the screenshot: The result of the proper call, the one without that extra argument.
Due to dumb luck, I also immediately figured out how to do all that with giving a desired file name:
"C:\Program Files\7-Zip\7zG.exe" a -ad -saa "BLABLABLA" -- "D:\eula.2052.txt"
This opens the shown window with the desired file name plus ".7z", and confirming the dialog will indeed compress the desired file into an archive of the file name, which is different from the file.