Solved

Unzipping a ZIP file using a .bat file on Windows 2003 Server

Posted on 2006-06-09
16
398 Views
Last Modified: 2008-01-09
Currently, we manually unzip files to deploy code on our Windows 2003 server.  How can I create a bat file to automatically unzip the file?  I am unable to determine what the syntax would be to do this.

So if I create a file called deploy.bat, what is the code to unzip a file called aspzip.zip?

I don't think we have any special zip program installed on our Windows 2003 server.  I think that it is just whatever cam from Microsoft for that OS.

Please let me know if you can assist.  

Thank you,

kpetti
0
Comment
Question by:kpetti
  • 5
  • 5
  • 3
  • +2
16 Comments
 
LVL 30

Expert Comment

by:callrs
ID: 16870511
See http://www.rarlab.com/rar_add.htm --> Command line freeware Windows UnRAR
0
 

Author Comment

by:kpetti
ID: 16870627
Hi callrs,

The only problem is that I work for a large corporation.  We aren't allowed to just install software that is not certified by the company that I work for.  We don't use any freeware software.

Any other thoughts on how to do this at the dos prompt using whatever is built in with Windows 2003?

Thanks for your quick response.

kpetti
0
 
LVL 5

Expert Comment

by:WmOfTewks
ID: 16870709
There are any number of zip tools and most of them support command line.  A favorite of mine is FilZip (http://www.filzip.com/en/index.html) which has a very simple command line interface.  From its help file:

===================================
Since Version 1.6, FilZip supports Command Line access. At the moment, you can only add & extract files to archives. Here are the parameters:

Usage:    filzip.exe <-command> [-<sw> [-<sw>...]] <archive_name> [<filename>...]
Example:  filzip.exe -a -rp test.zip *.txt
<Commands>

-a : Add files
-e : Extract files

<Switches>
Add

r : Add recursive
p : Save path names
f : Save full path info
s : Load filelist from parameter file

Extract

r : restore path names
o : overwrite existing files
u : update older files

Note:
If you want to add a big number of files to an archive, write them into a textfile, one in each line, use the -s switch and run with this file as parameter. Example:

filzip.exe -a -rps test.zip param.txt
===================================

If you want to get fancy (or difficult), Tugzip (http://www.tugzip.com/) uses JavaScript to do a whole range of operations.

Both are freeware but ask for donations, which I heartily endorse.
0
 
LVL 5

Accepted Solution

by:
WmOfTewks earned 125 total points
ID: 16870738
OK.  No freeware.  You might ask if WinZip is approved.  It is the defacto standard and has a command line interface (http://www.winzip.com/prodpagecl.htm).  And you have to pay, but not much.
0
 

Author Comment

by:kpetti
ID: 16870765
I think that WinZip is approved.  Is there a way to run the winzip commands from the command line using a bat file?  Please let me know if you can help.  Please let me know if you can help with syntax for WinZip.
0
 
LVL 5

Expert Comment

by:WmOfTewks
ID: 16870816
See the link.  It is about their command line interface add-on.
0
 
LVL 30

Expert Comment

by:callrs
ID: 16871191
Winrar  can surely be approved -- it's a vastly superior product! Why toot an inferior product?
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 16872623
> Winrar  can surely be approved -- it's a vastly superior product! Why toot an inferior product?

How naive.  Corporate IT departments rarely approve superior products.  Quality and usability simply don't factor into the approval process.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:ola_erik
ID: 16890584
Ive succesfully used the command line version of http://www.powerarchiver.com/download/ when packing files (and then ftp them to a remote location.)

This package doesnt have to be installed, just extracted. (if you appreciate the distinction) and its a small version (fully functional 7 USD shareware) of a commercial product.

a .bat file to unzip the file
aspzip.zip
would look like>

  paext aspzip.zip

the file paext.exe, the .bat file and the file to unzip have to be in the same directory.

The guys selling the software doesnt list their adress on the site though, it traces back to some chineese origin.
0
 

Author Comment

by:kpetti
ID: 16899401
Hi Everyone,

Thank you all for answering my question.  I appreciate all of the answers.  WinZip is currently supported at my company and we are looking into purchasing the command line add on.

Thank you,

kpetti
0
 
LVL 30

Expert Comment

by:callrs
ID: 16899438
Hmm. Sadly, brettmjohnson was right  :(

Looks like inertia may take a while to break, as is the case with QWERTY keyboard layout vs. the vastly superior DVORAK layout

kpetti, I challenge you to try at least the GUI version of Winrar & compare it to Winzip. The user-friendliness & functionality simply don't compare to Winzip.

brettmjohnson, lets try to get big Yahoo to accept rar files at geocities. If Yahoo does it, the others will follow :-D
0
 

Author Comment

by:kpetti
ID: 16899465
callrs,

For my home PC, I will look into that.  For the company that I work at, things don't work that way.  I don't have any control over what software our company purchases and certifies for use.  I work at a major corporation and unfortunetely, I would be fighting a losing battle.

Now if this was my previous employer, it was a very small firm and I would say that there was an 80 - 90 % chance that I could get them to use rarlab software.

Thanks for your suggestions.

kpetti
0
 
LVL 30

Expert Comment

by:callrs
ID: 16899668
>> "I would be fighting a losing battle."

Not necessarily a losing battle. Where would we be today if women, blacks, slaves etc. didn't fight "a losing battle"

Mountains are hard to move, but with intelligence, skill, and a step at a time, they can be. But we all must do our part, else it can take an eternity...

Change must start somewhere. Waves of change amplify as others pick up on & radiate them. To me, money/business/hedonism matters little vs. the real value of "what personal/business actions/products really help society", so  I will strive to the death to live up to the ideal of cultivating change for the better.

The issue of ties (the suit and tie kind, not politics) too was "a losing battle" for me for years, but finally someone at the top took note: The president of Japan, under a year ago, announced a personal dislike for & a public campaign against the ties. (story appeared in paper, but I can't locate it on the net cause of the "tie" word's double meaning. Closest found is this www.taipeitimes.com/News/world/archives/2005/06/01/2003257471)

I recently discovered that the grocery store giants Food Basics and A&P have finally started composting the vast produce they were sending to the landfill. A losing battle finally won & everyone wins in the process, including our environment.  : )


-R.S.

0
 

Author Comment

by:kpetti
ID: 16899712
I think you're right.  I'm going to go to work tomorrow and start a petition for us to get rarlab software.  I'll let you know how the fight goes...

Thank you for your words of inspiration.
0
 
LVL 30

Expert Comment

by:callrs
ID: 16899843
That's the spirit. Thanks :)

Just a footnote: Winrar is much better than winzip, but I don't know if there's anything better than even winrar.

If you want to reassign or split or increase the points, just click the "Support" link at top right. If not, well, your thanks -- and this chance at launching some spirited waves -- was great   :)

0
 
LVL 3

Expert Comment

by:ola_erik
ID: 16908103
sry if this a bit off topic,

regarding the DVORAK-QWERTY case
http://www.utdallas.edu/~liebowit/keys1.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since 2008, the stock markets have been in a haphazard state of fluctuation. At times it has been a steep decline (2008) and at others, a steady incline full of promise (2010). Just weeks ago, in August 2011, together we saw the stock markets plunge…
With the shift in today’s hiring climate (http://blog.experts-exchange.com/ee-blog/5-tips-on-succeeding-in-the-new-gig-economy/?cid=Blog_031816), many companies are choosing to hire freelancers to get projects completed efficiently and inexpensively…
Notifications on Experts Exchange help you keep track of your activity and updates in one place. Watch this video to learn how to use them on the site to quickly access the content that matters to you.
Where to go on the main page to find the job listings. How to apply to a job that you are interested in from the list that is featured on our Careers page.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now