7 zip 命令行相当于资源管理器扩展

7 zip command line equivalent to the explorer extension

我正在寻找等效于 Add to "FolderName.zip" 的资源管理器扩展选项的 7-zip 命令行调用:

我试过:

& 7z C:\path\To\SecondAttempt, C:\path\to\SecondAttempt.zip

我得到以下内容

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21

Command Line Error:
Unsupported command:
C:\path\to\SecondAttempt,

有谁知道 7-Zip 浏览器扩展的等效命令行?

Fo 7Zip 这应该是正确的语法

 . .z.exe a C:\path\to\SecondAttempt.zip "C:\path\To\SecondAttempt"

但我更愿意直接使用.NET

Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory("C:\path\To\SecondAttempt","C:\path\to\SecondAttempt.zip")

shell 扩展调用 7zG.exe,这是一个 GUI 实用程序,它显示了一个漂亮的 GUI window 如果这正是您要找的东西。使用 SysInternal ProcMon 可以查找使用的命令行,基本上:

& "C:\Program files-ZipzG.exe" a -tzip -slp- "a.zip" "file1.txt" "file2.txt"
  • 文件列表可以放入一个文件中,其名称在@之后指定,而不是文件名。
  • -slp-禁用大页面模式,-slp启用大文件压缩加速