By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

Winzip command line add-in

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
<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

P: n/a
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

P: n/a
"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

P: n/a
"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

P: n/a
> 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 discussion thread is closed

Replies have been disabled for this discussion.