Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unpacking files from a zip folder

Status
Not open for further replies.

LLEW3

Programmer
Apr 23, 2009
1
Hi, appreciate any suggestions for this:
after better solution than Im thinking of,to execute unpacking a zip file containing sub Folders each with single XML files, then move contents to a new folder on the client.

The context:
A compressed file containing XML files gets created by other process. The zip folder is then located on a shared network location. Users have a script on the client which remotely logs in to the shared network gets other files as they currently exist, but not dealt with a zip folder before.

I need to:
From the remote client select the compressed file from the shared location (have this coded already but not for the zipped file, but will just change the file name in the Get statement, if correct?). However Im after the code to unpack the zip file on the client machine, create a copy of an existing folder <orders> (holding previous data) so copy this folder as <ordersbkup>, get all the unpacked folder/XML files from the zip file and place into a new folder <orders> replacing the one just backed up.

Any thoughts appreciated....
 
Use the FileSystemObject Move method to to rename the existing folder. Then use it again to creat the new folder.

To extract from the zip file without usign a third party utility:
Code:
pathToZipFile="C:\NewOrders.zip" 
extractTo="C:\Orders\" 
Set objShell = CreateObject("Shell.Application") 
Set zippedFiles =objShell.NameSpace(pathToZipFile).items 
objShell.NameSpace(extractTo).CopyHere(zippedFiles)

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top