How to zip the files and password protect?

Hi All,

Please guide me how to zip my files and apply password to that zip file. It is very urgent requirement.I have been struck here.

I have files in zip format in folder ( D:Incoming ), i unzip the files and move the files into another folder (D:\File_process) and extract the files from File_process folder and load into target database. Once complete loading process,I have to move files into another folder(D:\Archive). But In Archive folder my files should be in zip and password protect.

I have done all process except zip the files and password protect.

Please your help appreciate.

Thanks
Venki


ursfriend77 (BOB member since 2011-03-02)

Hi,

One idea…If you can achieve the same functionality from command line…(you can find with some googling)
then you can call the same using exec function in DS.

You can try using winzip from command line.


Shivbaba :us: (BOB member since 2010-06-01)

print(exec(‘d:\programs\winzip\wzzip.exe’,’-yb -s[$Password] [$archivePath][$archiveDSN] [$sourcePath][$sourceDSN]’,8));

you need to have the command line client installed to execute. The docs on winzip explain the syntax quite well.


jlynn73 :us: (BOB member since 2009-10-27)

did you get how to zip a file using BODS.your help is appreciated.

Thanks,
Indira


indirank1 (BOB member since 2007-12-11)

Hi,
you can try the following Code:

exec(’<path of 7za.exe>’,‘a -t7z’ -p, 8 );

Path of 7za.exe can be generally - C:\Program Files\7-Zip\7za.exe - Please check your installation folder

Command ‘a’ is used to specify Archive in 7zip command line
Command -t7z will create Zip the file with 7z extension, alternatively you can use -tzip


Jay_mKumar :india: (BOB member since 2016-03-24)

This code works to password protect(hello) and zip it.

– Password protect

Exec (‘c:\Program Files\7-zip\7z’, ‘a -t7z -phello \<PAth>*.txt’);

thanks


indirank1 (BOB member since 2007-12-11)