How to zip a file using cmd line?

前端 未结 8 1242
灰色年华
灰色年华 2020-12-14 07:10

I want to zip a directory using bat file command.

For example if i want to unzip a file means i can use jar xf file.zip bat file command.

Like t

相关标签:
8条回答
  • 2020-12-14 07:59

    If you want a simple program that will run with .net 4.6.1 or above on Windows, I wrote this for my own purposes after finding this question.

    You simply cd to the directory above the folder you want to zip, then pass in the directory name and it will output mydir.zip. Add zipper to your path, I personally have a utils folder on C:\utils that have things like this in it.

    cd C:\Users\SomeUser\Desktop\
    zipper myfolder
    

    Below is the source code and copy of the exe:

    https://github.com/tryonlinux/commandLineZipper

    0 讨论(0)
  • 2020-12-14 08:00

    tar.exe -acf out.zip in.txt

    out.zip is an output folder or filename and in.txt is an input folder or filename. To use this command you should be in the file existing folder.

    0 讨论(0)
提交回复
热议问题