不知道你做错了什么。我假设您以某种方式混淆了示例。
压缩文件.bat
@echo off
pushd "S:\SourcePath"
"c:\program files\winzip\wzzip.exe" -a "S:\Destination\Sample.zip" -spassword *.txt
popd
我的输出从命令行运行。
C:\BatchFiles\zip>dir s:\sourcepath\*.* /b
file1.txt
file2.txt
file3.txt
C:\BatchFiles\zip>zipfiles.bat
WinZip(R) Command Line Support Add-On Version 4.0 64-bit (Build 10562)
Copyright (c) 1991-2013 WinZip International LLC - All Rights Reserved
Adding file1.txt
Adding file2.txt
Adding file3.txt
Total bytes=21, Compressed=63 -> -199 percent savings.
Copying Zip file "S:\Destination\Sample.zip".
C:\BatchFiles\zip>dir s:\destination\*.* /b
Sample.zip
C:\BatchFiles\zip>cd /D S:\Destination
S:\Destination>"C:\program files\winzip\wzunzip.exe" -spassword Sample.zip
WinZip(R) Command Line Support Add-On Version 4.0 64-bit (Build 10562)
Copyright (c) 1991-2013 WinZip International LLC - All Rights Reserved
Zip file: Sample.zip
Extracting file1.txt
Extracting file2.txt
Extracting file3.txt
S:\Destination>dir /b
file1.txt
file2.txt
file3.txt
Sample.zip
S:\Destination>