back file to zip via batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Nokin3
Posts: 2
Joined: 31 Jul 2022 11:32

back file to zip via batch file

#1 Post by Nokin3 » 09 Aug 2022 10:42

Image


I would like to backup file via zip. (before I use robocopy it use many hdd)
How could I make the batch file for zip without error?
What compression level is safe most?

thank you very much.

Nokin3
Posts: 2
Joined: 31 Jul 2022 11:32

Re: back file to zip via batch file

#2 Post by Nokin3 » 11 Aug 2022 12:10

@echo off
@title backup network drive
rem Configuration
set 7z=C:\Program Files\7-Zip\7z.exe

for /f "tokens=* delims=" %%X in ('type name-of-folder-in-network drive.txt') do 7z a "E:\%%X.zip" "%%X" | findstr /i /v "pavlov scanning compressing" > %userprofile%\Desktop\log\Foot4k\%%X.txt 2>&1

pause

---------
today I use this and I have 2files in network drive (1 name of folder,2 batfile code like this).
How I store 2 files in pc and run bat file for zip to hdd on this pc.

Post Reply