?
Solved

Windows 2008 R2 unzip command

Posted on 2013-01-23
9
Medium Priority
?
6,668 Views
Last Modified: 2013-01-29
I noticed that when a zip file is read using Win 2008 Explorer,
the Explorer is able to extract out the files from the zip.

In 7-zip, I can issue  '7z -l zipfile' to view contents of a zip file
& as a way to verify the zip file's integrity is intact.

Without 7-zip, winzip or any 3rd party, what's the equivalent
Windows 2008 command to view the contents of a zip file
(without getting into Explorer).

Reason I need this is I'm writing a Windows batch script to
check integrity of a zip file that is ftp'ed (get) over from a
remote ftp server.

In 7-Zip, I'll issue "7z -l zipfile" & then test the errorlevel ie
7z -l zipfile
if %errorlevel% NEQ 0 echo zipfile is bad
if %errorlevel% EQ 0 echo zipfile is good
0
Comment
Question by:sunhux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 9

Assisted Solution

by:TunerML
TunerML earned 400 total points
ID: 38809745
The 'compress' utility found on the W2k3 resource kit provides only basic functionality, for that end you could use it on the W2k8 server. I do not believe that it was even included in the W2k8 resource kit and therefore without a third party option you may be unable to complete this. Most admins I know use 7-zip as a full functional command line zip utility. 'Compress' is a very limited utility and most likely will not have a command line option to do integrity testing. Another expert may be able to shed more light but I am quite confident in my response.
0
 

Author Comment

by:sunhux
ID: 38809753
Just to add a bit:
my client disallows freeware/opensource tools (eg: 7zip)
to be installed on their Win2008 servers & they're not
prepared to pay for Commercial zipping tools so we
have to use Windows native zip/unzip.  The remote end's
management paid for Commercial zipping tool.

Can't use expand or compress commands as these commands
don't 'zip' up all files into one single zip file (as far as I understand)
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 1200 total points
ID: 38809849
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 16

Assisted Solution

by:AlexPace
AlexPace earned 400 total points
ID: 38809921
Here is an idea that is outside the box: Some FTP servers support integrity checking with CRC, MD5, SHA1 etc... You could use this feature to validate the accuracy of the file transfer so at least you'll know that if the zip file is somehow invalid then the source file on the remote server is also invalid in the exact same way.  

Another idea is to use a scriptable FTP client with error handling that includes zip capability in the scripting.  This way you could just attempt to unzip it and trap any error.  If no error you know it works.  

Another idea... have them PGP encrypt the zip file.  Attempt to decrypt the file.  If the transfer was not perfect the decryption will fail.
0
 

Author Comment

by:sunhux
ID: 38810015
AlexPace, the customer disallows any 3rd party/Opensource ftp
client & ftp server;  only MS ftp server & MS ftp client is allowed:
does MS ftp'ies have these features?

To re-emphasize, no 7-zip, freezip or freeware zips allowed while
they're not going to pay for commercial zip tools even if it costs
only US$10 for a commercial tool (unbelievable demand but that's
what my customer's policy is).

Arnold, what you gave in that url looks like a Powershell script,
not a VB.  I can use PS but what's the syntax to use that script
& what's the equivalent of '7z.exe -l zipfile' ?  Pls give examples.

I'm Powershell illiterate
0
 

Author Comment

by:sunhux
ID: 38810026
> what's the syntax to use that script & what's the equivalent of
> '7z.exe -l zipfile' ?  Pls give examples

Also, after executing that PS script, can I check its status by
' if %errorlevel% NEQ 0 ...... " ?

Also, give me a sample command of that PS script to unzip
a zipfile
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 1200 total points
ID: 38810187
I provided an example of a reference powershell script that you can test to see what information you can glean from it.
The reference to VB was a suggestion to explore whether a similar capacity/capability exist in vb the problem is that several links I ve thought of including refer to loading referencing resources outside the built into the MS OS.
http://stackoverflow.com/questions/30211/can-windows-built-in-zip-compression-be-scripted
IMHO, exploring a functionality of a script in a language I am not familiar helps to understand the I.e. you know the input and what you want to explore along withthe source data.
I am not in a position to dissect the powershell code to address directly your followup question.
0
 

Author Comment

by:sunhux
ID: 38818165
Just one last question:

my customer asks:  since it's possible to unzip
from Windows Explorer (in Win 2008 R2), isn't
there any equivalent command (at command
line) to do zip & unzip in Win 2008 ?  If there
is, what's those commands?
0
 
LVL 79

Accepted Solution

by:
arnold earned 1200 total points
ID: 38818743
Windows is primarily a graphical setup and many of its features are built into the graphical response.  The mechanism to open/extract the data is built-into explorer without an equivalent command line executable.  Using vbscript, powershell cmdlets is likely how you can get to do some, but the scope of the information you want/need might not be available without using alternate tools.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

770 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