6

Is there a 7-Zip command-line switch that prevents the filenames from echoing to the screen as they are added to the archive?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
KTLind
  • 147
  • 1
  • 2
  • 5

5 Answers5

6

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
workmad3
  • 25,101
  • 4
  • 35
  • 56
2

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Karl Glennon
  • 3,149
  • 4
  • 29
  • 31
1

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.

Community
  • 1
  • 1
freespace
  • 16,529
  • 4
  • 36
  • 58
0

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"
Bruno Dermario
  • 123
  • 2
  • 5
0

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.

Dario Solera
  • 5,694
  • 3
  • 29
  • 34