这个看似简单的问题,winrar程式UI上可以简单的做到,但是7-zip UI 介面就是没看到,去google上也是找好久。Confused

 

最后终于找到7-zip官网FAQ有纪录,但只能用command方式

How can I store full path of file in archive?

7-Zip stores only relative paths of files (without drive letter prefix). You can change current folder to folder that is common for all files that you want to compress and then you can use relative paths:

  cd /D C:\dir1\
  7z.exe a c:\a.7z file1.txt dir2\file2.txt

 

注:7z.exe一般都没有在XP path内,只打7z.exe无法直接执行,可参考下面我目前正在使用的方式

cd /D c:\temp\
"C:\Program Files\7-Zip\7z.exe" a -tzip  C:\test1.zip test\tes1.doc
"C:\Program Files\7-Zip\7z.exe" a -tzip  C:\test1.zip test\tes2.doc
"C:\Program Files\7-Zip\7z.exe" a -tzip  C:\test1.zip test\tes3.doc

相关文章