The best way to trigger WinZip from an Agent?

I have documents that each have an attached XML file in a Rich Text Field.

I have an Agent that detaches these XML files in batches, placing them in a temporary directory on the server.

After zipping the files – one zip file per batch – to be picked up by the Agent, placed in a document, and mailed.

Is there a way of putting this entire process in the Agent using Shell commands? If so, what is the correct syntax for these commands, given that we know the file names, etc.?

If not, would it be possible to trigger the zipping action via a batch file?

The process would also have to have a waiting period built in, or maybe use temporary trigger files that can be used for checking that the external process has been completed.

It sounds simple, but the problem is that I don’t know which commands or triggers I can use. Can anyone help me find a working example?

Subject: You could try this…

This way was suggested to zip files by using what’s built into Windows. Should be adaptable to LotusScript

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/50ce029efc294f31852575cc0000e3ea?OpenDocument

Subject: Here’s an example

There are others I found by searching google for Lotusscript zip

Subject: Thanks, but the script library has errors

I copied the script library code but evidently there is something still missing because I can’t get it to compile.

Subject: So try the other options

that come up with the Google search.
Example:

http://www.nsftools.com/tips/NotesTips.htm#zipfilemanager

or

http://www.vcode.no/vcode.nsf/downloads/VCZIPSUP

Subject: Update – I got it to work like this

I got it to work by installing WinZip with the Command Line extension (installed separately)

My code requires an existing directory.

These are portions of the relevant code:

If tZippen Then

… foutmelding = “”

… strZipFileName = strZippedFilesPath + UCase(strText1 + “_” + strText2 ) + “.zip”

… Call sZipKDMFiles1(strZipFileName, strZipFilePath, foutmelding )

End If

Sub sZipKDMFiles1(strZipFileName As String, strZipFilePath As String, foutmelding As String)

…Dim Session As New NotesSession

…Dim var As Variant

…Dim strCmd1 As String

…Dim strCmd2 As String

…Dim strDir As String

…strCmd1$ = |“c:\program files\winzip\wzzip” -m | + strZipFileName + " " + strZipFilePath + |*.xml|

…strCmd2$ = |“d:\program files\winzip\wzzip” -m | + strZipFileName + " " + strZipFilePath + |.|

…If Session.CommonUserName = “beheer Gofilex” Then

…var = Shell ( strCmd2$ )

…Else

…var = Shell ( strCmd1$ )

…End If

End Sub