0
  @echo off
    pushd "S:\SourcePath"
    "c:\program files\winzip\wzzip.exe" -a "S:\Destination\Sample.zip" *.txt  
    popd 

I think I am missing an additional line in this code to encrypt with a password.

I have added the option of -s before I posted this but it just falls over

  @echo off
    pushd "S:\SourcePath"
    "c:\program files\winzip\wzzip.exe" -a "S:\Destination\Sample.zip" -spassword *.txt  
    popd
JAL
  • 41,701
  • 23
  • 172
  • 300
User_Mode
  • 11
  • 1
  • 2

1 Answers1

0

Not sure what you are doing wrong. I assume you are somehow obfuscating examples.

Zipfiles.bat

@echo off
pushd "S:\SourcePath"
"c:\program files\winzip\wzzip.exe" -a "S:\Destination\Sample.zip" -spassword *.txt  
popd 

And my output running from the command line.

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>
Squashman
  • 13,649
  • 5
  • 27
  • 36