Is there a 7-Zip command-line switch that prevents the filenames from echoing to the screen as they are added to the archive?
-
2Shouldn't this be on superuser ? – Ohad Schneider Mar 04 '10 at 23:54
5 Answers
Not built in, but if you add
<7z command here> 2>&1 NUL
to the end of your command-line, it will redirect all the output into the null device and stops it echoing to the screen. This is the MS-DOS equivalent of
2>&1 /dev/null
in Linux and Unix systems.

- 30,738
- 21
- 105
- 131

- 25,101
- 4
- 35
- 56
7-Zip has no switch for this. If you are using PowerShell to call 7-Zip, you can redirect the output to null using Out-Null
. For example,
C:\PS>my-create-7zip-function | out-null

- 30,738
- 21
- 105
- 131

- 3,149
- 4
- 29
- 31
If it doesn't have one, you can still redirect the output using >
into a file, then deleting the file afterwards. If you are on *nix, you can redirect into /dev/null
.
Edit
In MS-DOS and cmd.exe
you can redirect into NUL, instead of a file. Thanks to agnul for this hint.
-
On windows systems you can redirect to NUL (works in cmd.exe, doesn't in powershell). – agnul Sep 18 '08 at 15:43
-
To avoid file names echoing on the screen and display only the confirmations, do:
...\right_path\7z a output.zip folder_to_be_compressed | findstr /b /r /c:"\<Everything is Ok" /c:"\<Scanning" /c:"\<Creating archive"

- 123
- 2
- 5
AFAIK, there is not a switch for that, but you could hide the output redirecting it to a file, for example (DOS batch):
7z.exe ... normal parameters > DumpFile.txt
This way all the output ends in DumpFile.txt and not on the screen.

- 5,694
- 3
- 29
- 34