473,499 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Winzip command line add-in

Is there anyone with experience using the Winzip command line add-in?

I can't get it to create the zip file with a space in the file name.

Using:

RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip
C:\MyOtherFolder\MyFile.mdb")

What is the syntax when you want a space in the zipfile file name?

Thanks!

Steve
Nov 12 '05 #1
10 9265
Hi,
Enclose the path in qoutes in quotes:
RetValue = Shell("C:\winzip\wzzip.exe" & """C:\MyFolder\My ZipFile.Zip""" &
"C:\MyOtherFolder\MyFile.mdb")
something like that.
I work a lot with Shell and what i do is build the string into variable(s)
instead of putting it directly in the call. That way I can see what my string looks
before I make the call. If you don't do this, it's pretty easy to drive youself
crazy trying to figure out the correct syntax.
Basically, any path with spaces in it must be enclosed in quotes, just
like when you run it from the command line prompt.

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message news:Jo******************@newsread1.news.atl.earth link.net... Is there anyone with experience using the Winzip command line add-in?

I can't get it to create the zip file with a space in the file name.

Using:

RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip
C:\MyOtherFolder\MyFile.mdb")

What is the syntax when you want a space in the zipfile file name?

Thanks!

Steve

Nov 12 '05 #2
Dan,

Thank you for responding!

I think you're on the right track - help me to understand what you have shown
me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret
that then as a string enclosed by double quotes. To me then the string enclosed
by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.

Or did you leave out two ampersands and mean it to be:
""" & C:\MyFolder\My ZipFile.Zip & """

Thanks for the help!

Steve
"Dan Artuso" <da*****@NoSpampagepearls.com> wrote in message
news:#C**************@TK2MSFTNGP12.phx.gbl...
Hi,
Enclose the path in qoutes in quotes:
RetValue = Shell("C:\winzip\wzzip.exe" & """C:\MyFolder\My ZipFile.Zip""" &
"C:\MyOtherFolder\MyFile.mdb")
something like that.
I work a lot with Shell and what i do is build the string into variable(s)
instead of putting it directly in the call. That way I can see what my string

looks before I make the call. If you don't do this, it's pretty easy to drive youself crazy trying to figure out the correct syntax.
Basically, any path with spaces in it must be enclosed in quotes, just
like when you run it from the command line prompt.

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message

news:Jo******************@newsread1.news.atl.earth link.net...
Is there anyone with experience using the Winzip command line add-in?

I can't get it to create the zip file with a space in the file name.

Using:

RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip
C:\MyOtherFolder\MyFile.mdb")

What is the syntax when you want a space in the zipfile file name?

Thanks!

Steve


Nov 12 '05 #3
Hi Steve,
The easiest way is to start out with the string the way you know it has to look
and then do the concatenation to make it so.

Any path with spaces has to be enclosed in quotes, so if you were to type
this in at the command prompt you would do this:
C:\winzip\wzzip.exe "C:\MyFolder\My ZipFile.Zip" C:\MyOtherFolder\MyFile.mdb (at least I'm pretty sure that's what it would be. when I build this stuff I always get it working
from the command prompt first, that way I know what the string has to look like)

and that's the end result you want.
Now the way I build these things is one part at a time.
For the above I would have three variable and concatenate them together.

cmdLine = "C:\winzip\wzzip.exe"
arg1 = """C:\MyFolder\My ZipFile.Zip"""
arg2 = "C:\MyOtherFolder\MyFile.mdb"

notice there are two extra quotes on either side of arg1.
In order to get a literal quote you have to place two quotes in your
quoted string.
and..
finalArg = cmdLine & " " & arg1 " " & arg2
Debug.Print finalArg

which should show:
C:\winzip\wzzip.exe "C:\MyFolder\My ZipFile.Zip" C:\MyOtherFolder\MyFile.mdb
in the immediate window

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message news:pH******************@newsread1.news.atl.earth link.net... Dan,

Thank you for responding!

I think you're on the right track - help me to understand what you have shown
me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret
that then as a string enclosed by double quotes. To me then the string enclosed
by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.

Or did you leave out two ampersands and mean it to be:
""" & C:\MyFolder\My ZipFile.Zip & """

Thanks for the help!

Steve
"Dan Artuso" <da*****@NoSpampagepearls.com> wrote in message
news:#C**************@TK2MSFTNGP12.phx.gbl...
Hi,
Enclose the path in qoutes in quotes:
RetValue = Shell("C:\winzip\wzzip.exe" & """C:\MyFolder\My ZipFile.Zip""" &
"C:\MyOtherFolder\MyFile.mdb")


something like that.
I work a lot with Shell and what i do is build the string into variable(s)
instead of putting it directly in the call. That way I can see what my string

looks
before I make the call. If you don't do this, it's pretty easy to drive

youself
crazy trying to figure out the correct syntax.
Basically, any path with spaces in it must be enclosed in quotes, just
like when you run it from the command line prompt.

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message

news:Jo******************@newsread1.news.atl.earth link.net...
Is there anyone with experience using the Winzip command line add-in?

I can't get it to create the zip file with a space in the file name.

Using:

RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip
C:\MyOtherFolder\MyFile.mdb")

What is the syntax when you want a space in the zipfile file name?

Thanks!

Steve



Nov 12 '05 #4
Steve,
I think you're on the right track - help me to understand what you have shown
me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret
that then as a string enclosed by double quotes. To me then the string enclosed
by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.
Or did you leave out two ampersands and mean it to be:
""" & C:\MyFolder\My ZipFile.Zip & """


If this application is running on more than one machine you ought to read
the program path for wzzip from the registry:

1. Get fReturnRegKeyValue from
http://www.mvps.org/access/api/api0015.htm

2. Read wzzip folder:
strWZZip = fReturnRegKeyValue(HKEY_LOCAL_MACHINE,
"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wzzip.exe", "")
(valid for W2k and WXP)

3. Build a string containing the entire command:
MyString = """" & strWZZip & """" & " " & _
"""C:\MyFolder\My ZipFile.Zip""" & _
" " & """C:\MyOtherFolder\MyFile.mdb"""
RetValue = Shell(MyString)

(Mind the quotes _and_ blanks! Check the result in the immediate pane.)

HTH - Peter

--
No mails please.
Nov 12 '05 #5
Sorry, the final line should be:
finalArg = cmdLine & " " & arg1 & " " & arg2

--
HTH
Dan Artuso, Access MVP
"Dan Artuso" <da*****@NoSpampagepearls.com> wrote in message news:##*************@TK2MSFTNGP12.phx.gbl...
Hi Steve,
The easiest way is to start out with the string the way you know it has to look
and then do the concatenation to make it so.

Any path with spaces has to be enclosed in quotes, so if you were to type
this in at the command prompt you would do this:
C:\winzip\wzzip.exe "C:\MyFolder\My ZipFile.Zip" C:\MyOtherFolder\MyFile.mdb

(at least I'm pretty sure that's what it would be. when I build this stuff I always get it working
from the command prompt first, that way I know what the string has to look like)

and that's the end result you want.
Now the way I build these things is one part at a time.
For the above I would have three variable and concatenate them together.

cmdLine = "C:\winzip\wzzip.exe"
arg1 = """C:\MyFolder\My ZipFile.Zip"""
arg2 = "C:\MyOtherFolder\MyFile.mdb"

notice there are two extra quotes on either side of arg1.
In order to get a literal quote you have to place two quotes in your
quoted string.
and..
finalArg = cmdLine & " " & arg1 " " & arg2
Debug.Print finalArg

which should show:
C:\winzip\wzzip.exe "C:\MyFolder\My ZipFile.Zip" C:\MyOtherFolder\MyFile.mdb
in the immediate window

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message news:pH******************@newsread1.news.atl.earth link.net...
Dan,

Thank you for responding!

I think you're on the right track - help me to understand what you have shown
me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret
that then as a string enclosed by double quotes. To me then the string enclosed
by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.

Or did you leave out two ampersands and mean it to be:
""" & C:\MyFolder\My ZipFile.Zip & """

Thanks for the help!

Steve
"Dan Artuso" <da*****@NoSpampagepearls.com> wrote in message
news:#C**************@TK2MSFTNGP12.phx.gbl...
Hi,
Enclose the path in qoutes in quotes:
RetValue = Shell("C:\winzip\wzzip.exe" & """C:\MyFolder\My ZipFile.Zip""" &
> "C:\MyOtherFolder\MyFile.mdb")

something like that.
I work a lot with Shell and what i do is build the string into variable(s)
instead of putting it directly in the call. That way I can see what my string

looks
before I make the call. If you don't do this, it's pretty easy to drive

youself
crazy trying to figure out the correct syntax.
Basically, any path with spaces in it must be enclosed in quotes, just
like when you run it from the command line prompt.

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message

news:Jo******************@newsread1.news.atl.earth link.net...
> Is there anyone with experience using the Winzip command line add-in?
>
> I can't get it to create the zip file with a space in the file name.
>
> Using:
>
> RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip
> C:\MyOtherFolder\MyFile.mdb")
>
> What is the syntax when you want a space in the zipfile file name?
>
> Thanks!
>
> Steve
>
>



Nov 12 '05 #6
<In order to get a literal quote you have to place two quotes in your quoted
string.>

I never needed to do this so didn't know you had to use two quotes. One learns
something every day!

Thanks, Dan!!

Steve

"Dan Artuso" <da*****@NoSpampagepearls.com> wrote in message
news:##*************@TK2MSFTNGP12.phx.gbl...
Hi Steve,
The easiest way is to start out with the string the way you know it has to look and then do the concatenation to make it so.

Any path with spaces has to be enclosed in quotes, so if you were to type
this in at the command prompt you would do this:
C:\winzip\wzzip.exe "C:\MyFolder\My ZipFile.Zip" C:\MyOtherFolder\MyFile.mdb (at least I'm pretty sure that's what it would be. when I build this stuff I

always get it working from the command prompt first, that way I know what the string has to look like)
and that's the end result you want.
Now the way I build these things is one part at a time.
For the above I would have three variable and concatenate them together.

cmdLine = "C:\winzip\wzzip.exe"
arg1 = """C:\MyFolder\My ZipFile.Zip"""
arg2 = "C:\MyOtherFolder\MyFile.mdb"

notice there are two extra quotes on either side of arg1.
In order to get a literal quote you have to place two quotes in your
quoted string.
and..
finalArg = cmdLine & " " & arg1 " " & arg2
Debug.Print finalArg

which should show:
C:\winzip\wzzip.exe "C:\MyFolder\My ZipFile.Zip" C:\MyOtherFolder\MyFile.mdb
in the immediate window

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message

news:pH******************@newsread1.news.atl.earth link.net...
Dan,

Thank you for responding!

I think you're on the right track - help me to understand what you have shown me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret that then as a string enclosed by double quotes. To me then the string enclosed by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.

Or did you leave out two ampersands and mean it to be:
""" & C:\MyFolder\My ZipFile.Zip & """

Thanks for the help!

Steve
"Dan Artuso" <da*****@NoSpampagepearls.com> wrote in message
news:#C**************@TK2MSFTNGP12.phx.gbl...
Hi,
Enclose the path in qoutes in quotes:
RetValue = Shell("C:\winzip\wzzip.exe" & """C:\MyFolder\My ZipFile.Zip""" & > "C:\MyOtherFolder\MyFile.mdb")

something like that.
I work a lot with Shell and what i do is build the string into variable(s)
instead of putting it directly in the call. That way I can see what my
string looks
before I make the call. If you don't do this, it's pretty easy to drive

youself
crazy trying to figure out the correct syntax.
Basically, any path with spaces in it must be enclosed in quotes, just
like when you run it from the command line prompt.

--
HTH
Dan Artuso, Access MVP
"Steve" <sa****@penn.com> wrote in message

news:Jo******************@newsread1.news.atl.earth link.net...
> Is there anyone with experience using the Winzip command line add-in?
>
> I can't get it to create the zip file with a space in the file name.
>
> Using:
>
> RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip
> C:\MyOtherFolder\MyFile.mdb")
>
> What is the syntax when you want a space in the zipfile file name?
>
> Thanks!
>
> Steve
>
>



Nov 12 '05 #7
Thanks, Peter, for responding!

Yes, my application could run on different machines so I will use what you have
shown me.

Steve
"Peter Doering" <ne**@doering.org> wrote in message
news:bk************@ID-204768.news.uni-berlin.de...
Steve,
I think you're on the right track - help me to understand what you have shown me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret that then as a string enclosed by double quotes. To me then the string enclosed by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.
Or did you leave out two ampersands and mean it to be:
""" & C:\MyFolder\My ZipFile.Zip & """


If this application is running on more than one machine you ought to read
the program path for wzzip from the registry:

1. Get fReturnRegKeyValue from
http://www.mvps.org/access/api/api0015.htm

2. Read wzzip folder:
strWZZip = fReturnRegKeyValue(HKEY_LOCAL_MACHINE,
"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wzzip.exe", "")
(valid for W2k and WXP)

3. Build a string containing the entire command:
MyString = """" & strWZZip & """" & " " & _
"""C:\MyFolder\My ZipFile.Zip""" & _
" " & """C:\MyOtherFolder\MyFile.mdb"""
RetValue = Shell(MyString)

(Mind the quotes _and_ blanks! Check the result in the immediate pane.)

HTH - Peter

--
No mails please.

Nov 12 '05 #8
"Steve" <sa****@penn.com> wrote:
<In order to get a literal quote you have to place two quotes in your quoted
string.>

I never needed to do this so didn't know you had to use two quotes. One learns
something every day!


The only way out of that rule I've ever encountered was using Hollerith Format
Specification in Fortran. Mind you that was back in about 1975 I came across that
one. So it's unlikely you'll encounter it any time soon.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #9
"Steve" <sa****@penn.com> wrote:
Is there anyone with experience using the Winzip command line add-in?


Alternatively you could try an altnerative to Winzip so as to avoid licensing issues.
At least one of the zip utilities at my website is free and open source. See
Compression DLLs, OCXs, etc at http://www.granite.ab.ca/access/compression.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #10
> I think you're on the right track - help me to understand what you have shown
me. It looks like you have a double quote enclosed by double quotes at the
beginning and end of C:\MyFolder\My ZipFile.Zip. Is that correct? I interpret
that then as a string enclosed by double quotes. To me then the string enclosed by double quotes is:
""C:\MyFolder\My ZipFile.Zip""
I don't understand this, can you explain.


To embed a double quote (") in a string, you need to double-up the double quote
character:

"""" is seen in the resulting string as "

"""This is a Quote.""" is seen in the resulting string as "This is a Quote."

:-)
--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #11

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

Similar topics

2
2074
by: James Baker | last post by:
I'm using ASP and I need to generate a ZIP file that contains a list of files that I'm pulling from a database. I've determined WinZip's command line parameters so that I can use it, the problem...
4
3267
by: EdB | last post by:
Has anyone ever interfaced with winZip from inside a VB.Net app? I'm looking to automatically zip up some files then delete them.
2
5680
by: Jim | last post by:
I all, I have a database on a user's network drive with the following path: E:\NewDB\StatsData.mdb I want to create a small "Utilities" database that the user can launch which will run WinZip...
7
20978
by: Pengyu | last post by:
How to call up WinRAR or WinZip to decompress files without bring up WinRAR or WinZip windows? Just like the "Extract here" if you right click an rar/zip file using your mouse. Thank you very...
2
1969
by: Derrick | last post by:
Is there any core assembly class that can compress/decompress files similar to winzip? I found how to create custom actions. What I would like to do is write something that decompresses winzip...
1
302
by: John Biddiscombe | last post by:
Hello, I don't get any output until the build finishes using this command line... "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe" test.sln /build debug /project proj1...
15
11105
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 (...
34
6820
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
16
2682
by: John Salerno | last post by:
Here's my new project: I want to write a little script that I can type at the terminal like this: $ scriptname package1 where scriptname is my module name and any subsequent arguments are the...
6
1556
by: shana07 | last post by:
Friends, I wish to consult about this big arithmetic program. This program basically is calculating big numbers. It work great from command prompt, for instance: java bigal 99999999999999999 + 5....
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.