Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 16th, 2007, 12:17 PM
Javi Javi is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 15 Javi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m
Reputation Power: 0
Opening zip files using Shell.Application

Hey, all. I'm trying to 1) read the contents of a zip file, then to 2) unzip it into a folder that I specify. We'll get to the unzipping later. Here's the code to read the list of items in a zip file:

Code:
zipfile = "D:\www\stuffhere\html\textzip.zip"
'unzipdir = "D:\www\stuffhere\html\unzipped"

Set objShell = CreateObject("Shell.Application")
Set SrcFldr=objShell.NameSpace(zipfile)
Set DestFldr=objShell.NameSpace(unzipdir)
if srcfldr is nothing then
 response.write "Zip file not found"
else
 if DestFldr is nothing then
  response.write "Unzip Directory file not found"
 else
  Set FldrItems=SrcFldr.Items
For Each objItem in FldrItems
    response.write objItem.Name & "<br>"
Next
 end if
end if


In my Win XP Pro testing environment, I am able to read and list each file within the zip file. Here's my problem: In Windows 2k server, I cannot read the contents of the zip file. I've read somewhere that XP treats .zip files as folders, so it may not apply to 2k server.

In Windows 2k3 Server, however, I get an unspecifed error once I try to invoke
Code:
Set SrcFldr=objShell.NameSpace(zipfile)

The only thing I get is an error Number=(0x80070002)


Any ideas on either?

Reply With Quote
  #2  
Old January 17th, 2007, 05:29 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,635 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 55 m 37 sec
Reputation Power: 1902
XP has zip utility built in. other versions of Windows probably
don't have this luxury, so you'll have to find command line
zip utility.
I'm using PKZIP25 which works very well and it's very simple
to use.

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > Opening zip files using Shell.Application


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT