Solved

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

Posted on 2006-06-09
16
394 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
Comment Utility
See http://www.rarlab.com/rar_add.htm --> Command line freeware Windows UnRAR
0
 

Author Comment

by:kpetti
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
See the link.  It is about their command line interface add-on.
0
 
LVL 30

Expert Comment

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

Expert Comment

by:brettmjohnson
Comment Utility
> 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 3

Expert Comment

by:ola_erik
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>> "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
Comment Utility
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
Comment Utility
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
Comment Utility
sry if this a bit off topic,

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Surprisingly, there is a lot to Gym battles, and I thought it would be helpful to share knowledge about all the ins and outs of this feature!
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
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.

763 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

10 Experts available now in Live!

Get 1:1 Help Now