help! how to compress file
Posted: 28 Apr 2020 04:31
hello,
I want to compress a specific folder and togerther with a file..
let's say I'm gonna zip a file
ex.
in my desktop i have this structure
inside my compress folder I have this
Fruits
- Folder A
- a.txt
- b.txt
- Folder B
- a.txt
-b.txt
a.bin
b.bin
c.bin
I want to zip Fruits folder + b.bin into a one zip file ex.hellow.zip
then delete Fruits folder and b.bin
I think I get what I want but the problem I can't delete the Fruit folder and it's sub folder
@echo off
:compress
set path=Fruits
set path2=b.bin
set z=compressed.zip
7z.exe a -tzip compressed.zip "%path%"
7z.exe a -tzip compressed. zip "%path2%"
if exist "%path%" (
for /d %%p in ("%path%"\*.*") do rmdir "%%p" /s /Q
del /s /q %path%\*.*
thank you
I want to compress a specific folder and togerther with a file..
let's say I'm gonna zip a file
ex.
in my desktop i have this structure
inside my compress folder I have this
Fruits
- Folder A
- a.txt
- b.txt
- Folder B
- a.txt
-b.txt
a.bin
b.bin
c.bin
I want to zip Fruits folder + b.bin into a one zip file ex.hellow.zip
then delete Fruits folder and b.bin
I think I get what I want but the problem I can't delete the Fruit folder and it's sub folder
@echo off
:compress
set path=Fruits
set path2=b.bin
set z=compressed.zip
7z.exe a -tzip compressed.zip "%path%"
7z.exe a -tzip compressed. zip "%path2%"
if exist "%path%" (
for /d %%p in ("%path%"\*.*") do rmdir "%%p" /s /Q
del /s /q %path%\*.*
thank you