我想从Windows服务器上的批处理文件中压缩文件夹结构。让我们说Structure就像D:/ DBA /和DBA里面有很多带文件的文件夹,而在DBA文件夹里也有文件。现在我想压缩这个DBA文件夹及其中的所有文件夹和文件。
请建议我如何从批处理文件中实现此目的。提前致谢
答案 0 :(得分:1)
多个论坛建议Windows内置的zip功能由dlls
提供,其中没有命令行参数。例如:
The unzipping is a function of `zipfldr.dll`, so would use `regsvr32.exe` to invoke it, and as far as I know there are no arguements you can add to it for unzipping via batch file.
我会推荐第三方程序,其中有很多(你可以提供脚本):7zip, winzip, pkzip
等。
您也可以在下面查看批处理文件的替代方法:
答案 1 :(得分:0)
如果没有第三方zip工具,这是不可能的。 Windows不包含命令行zip工具。
答案 2 :(得分:0)
这是不可能的,因为Windows Server没有ZIP兼容的归档程序。 作为"内置"选项,您可以选中Windows Server Resource Kit Tools下载,其中包含compress.exe工具,但它与.zip格式不兼容。 另一个选择是使用7zip独立(7za)可执行文件,它不需要安装和工作,开箱即用#34;