Compressing only files using 7z without preserving the path

前端 未结 5 684
梦谈多话
梦谈多话 2021-02-03 18:57

I am using 7z command line executable to zip files, but I see that while adding to an archive the path of the files is preserved in the archive.

So if I do



        
5条回答
  •  遇见更好的自我
    2021-02-03 19:52

    This worked for me

    Consider folder structure like C:\Parent\SubFolders..... And you want to create parent.zip which will contain all files and folders C:\Parent without parent folder [i.e it will start from SubFolders.....]

    cd /D "C:\Parent"
    
    "7z.exe" a Parent.zip "*.*" -r
    

    This will create Parent.zip in C:\Parent

提交回复
热议问题