473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

using winzip command line processor

I am trying to incorparate the win zip command line processor in my
code on an Access 2003 database form. The code that I downloaded made
a call to the windows api. It requires that you use short names
because it works in the command window. The call is to
apiGetShortPathName from the kernel. It works great for returning the
short name for the xls file I am zipping. But then when I use the same
path and name with a zip extension is comes back empty. Is there some
security issue with zip files that it is running into? This call is
from a function called fGetShortName that I downloaded from the
mvps.org website.

Nov 27 '06 #1
1 5107

hannahg wrote:
I am trying to incorparate the win zip command line processor in my
code on an Access 2003 database form. The code that I downloaded made
a call to the windows api. It requires that you use short names
because it works in the command window. The call is to
apiGetShortPathName from the kernel. It works great for returning the
short name for the xls file I am zipping. But then when I use the same
path and name with a zip extension is comes back empty. Is there some
security issue with zip files that it is running into? This call is
from a function called fGetShortName that I downloaded from the
mvps.org website.
You don't have to use the short name - you can pass in a regular
Windows Path if you surround it in quotes. The following function will
automatically compress a password protected zip file and FTP it using
the InetCtls ocx. This is compiled code so I'm not gonna change it for
readability, but most of the variable names and functionality should be
decipherable. The lines you are interested in are these:

wkCmnd = "C:/Program Files/WinZip/wzzip.exe -yp -s" & Me.ufISACFtpPwd
& " """ & wkZipt & """ """ & wkText & """"
OK = Shell(wkCmnd, vbMaximizedFocus)
wkCmnd is a string, OK is a boolean. wkZipT is the path of the Zip file
being created and wkText is the path to the text file source. See the
Winzip command line processor help for any questions on the the wzzip
command line parameters I've got here.

Remember that to insert a double quote inside a string literal you have
to put 2 double quotes together so & " """ will concatenate one space
and double-quote to the text string being fabricated.
<compiled code>

Private Sub btnISACFileSend_Click()
Dim TX As New InetCtlsObjects.Inet
Dim wkPath As String
Dim wkText As String
Dim wkZipt As String
Dim wkDest As String
Dim wkCmnd As String
Dim OK As Boolean
Dim SQ As String

On Error GoTo ISACFileSendErr
SQ = "Sending MAP Payment Request File to ISAC FTP server!!!" &
vbCrLf & _
"Do you wish to continue?"

If (MsgBox(SQ, vbYesNo, "Post MAP to ISAC") <vbYes) Then GoTo
ISACFileSendExit

wkPath = DLookup("[usTempPath]", "uSysCtl", "[usID] = 1")
ChDir wkPath

wkText = wkPath & "\" & Me.ufISACFtpSource
wkZipt = wkPath & "\" & Me.ufISACFtpDest
wkDest = Me.ufISACFtpDest

wkCmnd = "C:/Program Files/WinZip/wzzip.exe -yp -s" & Me.ufISACFtpPwd
& " """ & wkZipt & """ """ & wkText & """"
OK = Shell(wkCmnd, vbMaximizedFocus)

With TX
.Protocol = icFTP
.URL = Me.ufISACFtpIP
.UserName = Me.ufISACFtpUser
.Password = Me.ufISACFtpPwd

wkCmnd = "SEND " & wkZipt & " " & wkDest
.Execute , wkCmnd
End With

OK = MsgBox("MAP Payment Request File Successfully Posted", vbOKOnly,
"MAP File Send Success!!!")

ISACFileSendExit:
Set TX = Nothing
Exit Sub

ISACFileSendErr:
If (Err = 53) Then
Resume Next
Else
MsgBox "Error in ISACFileSend: " & Err & ": " & Err.Description
Resume ISACFileSendExit
End If
End Sub
</compiled code>

King Ron of Chi

Dec 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows...
15
by: Karl | last post by:
Hi all, I regularly use FTP to place Self Extracting Zip files on the web for remote users to update their datafiles. Works very nicely. I have automated the creation of the initial zip file (...
6
by: sri2097 | last post by:
Hi, I'm trying to zip a particular fiolder and place the zipped folder into a target folder using python. I have used the following command in 'ubuntu'. zip_command = 'zip -qr %s %s' % (target,...
4
by: enjoywithneha | last post by:
Can anyone here please tell me how the system function is used to execute DOS commands?
5
by: benyod79 | last post by:
I'm hoping someone will be able to assist with this one. Using a scheduling program I'd like to run a batch file that runs a macro to creat e a copy of the opened database. Then, using batch again,...
8
by: Ivan | last post by:
Hi I am new in DB2, and I have some problems when I try run stored procedures, and others statements. I made one stored procedure very simple, but this show different messages. I have followed...
1
by: Josec84 | last post by:
Im writing a script and need help. I need to extract a file using the command prompt. Are there commands to extract files or unzip files(without downloading any add-ons)??? Let's say i have a file...
5
by: Nilam2477 | last post by:
i need to zip the files/folder. How can i use winzip32.exe in C# code to programatically zip the files or folder. If you could provide some sample code that would be great. Thanks
0
by: yugho | last post by:
I'm sorry if I post Winzip question here, but I met a problem. I was running Winzip command by using process in VB.Net, but I had error that I don't know how to trace. 1. I create a batch file:...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.