0
votes
1answer
98 views

7z in batch file with variables “Incorrect command line”

I'm trying to run the following batch file: set HH=%time:~0,2% set HH=%HH: =0% IF %time:~0,2% GTR 5 ( IF %time:~0,2% LSS 21 ( FOR /F "TOKENS=1 DELIMS=:" %%A IN ('TIME/T') DO SET HH=%%A XCOPY ...
1
vote
1answer
127 views

7-zip -xr!*.bat is creating an empty archive with the batch files name

I am trying to exclude files from a 7-zip batch. The syntax is: for %%A in (*) do "C:\Program Files\7-Zip\7z.exe" a -tzip -xr!*.docx "%%A.zip" "%%A" -xr!*.bat The command is creating zip files ...
0
votes
1answer
89 views

How can I create a batch job (.bat) that zip a folder?

From 7zip I've downloaded their command line tool 7za.exe, and I have to following script: echo off cls set zip ="C:\7za.exe" set filename="%date%.backup.zip" set pathtobackup="C:\MyDocs" %zip% ...
0
votes
1answer
448 views

How to show extraction progress of 7zip inside cmd?

7z.exe do not show any extraction progress in cmd."C:\Program Files\7-Zip\7zG.exe" -y x -pPASSWORD "D:\Myfile.rar" Extracts the file with a GUI progress-bar. But I don't want a GUI progress bar. I ...
0
votes
0answers
51 views

Batch rearchive zip into 7z using best options and asking for each what to do

Batch repacking zip archives into 7z this one helps a bit, but I would like to get asked for each ZIP files to what to do(opts: delete, repack, leave as it is), and idk if this script does, but after ...
3
votes
3answers
2k views

What does the percent sign (% and %%) in a batch file argument mean?

I think I'm missing something because I can't seem to find what this means. Example: for /D %%A in (*) do "\7za.exe" u -t7z -m9=LZMA2 "%%A.7z" "%%A" That line was supposed to use a command line ...
0
votes
1answer
217 views

How to create ZIPs with the content of every folder [duplicate]

I have several folders and I need to compress the content of each folder in a separate ZIP file. However, every ZIP should only contain the content of each folder and not the folder itself. The ...
4
votes
2answers
4k views

How to write error status for command line 7-zip in variable (or, instead, in text file)

I use 7-zip (in my batch files) to pack some directory and send archive by email. When I use some file in this directory at the same time the batch file is running (I start the batch files with Task ...
0
votes
2answers
1k views

cmd: include date and time to filename

How can I get a filename YYYY.MM.DD_HH.MM.SS.7z? It should work with any regional settings! The question is not duplicating 7zip CMD: Add current date to archive & include only last modified ...
2
votes
1answer
6k views

Why does 7-zip.exe return “Access is denied” with these arguments/parameters?

In a batch file: START "7-zip" /D "C:\Program Files\7-Zip\" "7z.exe" a -o <F:> testArchive F:\test Or, alone on the cmd as: 7z.exe a -o <C:\users\user\Desktop> testArc ...
2
votes
1answer
363 views

How can I compress multiple files into three files per archive with 7-Zip?

I have 100 files that look like this: 001.txt 002.txt 003.txt 004.txt ..... 100.txt I want to compress them like this: 001.txt 002.txt ----> archive01.7z 003.txt --------- 004.txt 005.txt ...
2
votes
1answer
6k views

Batch the “Extract Here” command

I would like to batch the "Extract Here..." command on a complete folder. Every type of archive should be unzipped into the current folder with the name of the archive file. I have found some BATCH ...
1
vote
2answers
222 views

How to determine the name of a file extracted from a zip archive via a batch script

Background I have a batch file on Windows XP which takes one argument: a zip file name that was created with 7-zip. This file contains a single MySQL backup file inside: backup.sql. I would like to ...
7
votes
3answers
3k views

How to disable the output of 7-Zip?

I use 7-Zip to compress files inside a batch file like this: ...\right_path\7z a output_file_name.zip file_to_be_compressed I got the following output: 7-Zip 4.65 Copyright (c) 1999-2009 Igor ...
8
votes
8answers
17k views

How to make 7-zip do a whole bunch of folders

I got a bunch of pictures that I had to crop into 800x600 pixels. That was easily done, but now I have to upload them so the family can see them all. Thing is, this is 500MB in pictures. I decided to ...