6

是否有一个 7-Zip 命令行开关可以防止文件名在添加到存档时回显到屏幕上?

4

5 回答 5

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.

于 2008-09-18T15:42:34.217 回答
2

7-Zip 对此没有开关。如果您使用 PowerShell 调用 7-Zip,您可以使用Out-Null. 例如,

C:\PS>my-create-7zip-function | out-null
于 2011-04-20T18:01:56.640 回答
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.

于 2008-09-18T15:41:17.027 回答
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.

于 2008-09-18T15:43:04.090 回答
0

为避免文件名在屏幕上回显并仅显示确认信息,请执行以下操作:

...\right_path\7z a output.zip folder_to_be_compressed | findstr /b /r /c:"\<Everything is Ok" /c:"\<Scanning" /c:"\<Creating archive"
于 2012-08-31T04:25:58.080 回答