Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Windows Script that will Save Files to ZIP file
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
LJB  
View profile  
 More options Sep 11 2007, 8:23 am
Newsgroups: microsoft.public.windows.server.scripting
From: "LJB" <.>
Date: Tue, 11 Sep 2007 07:23:33 -0500
Local: Tues, Sep 11 2007 8:23 am
Subject: Re: Windows Script that will Save Files to ZIP file

"M P" <mponte...@gmail.com> wrote in message

news:1189479273.999620.23430@d55g2000hsg.googlegroups.com...

>I have C:\Data\*.* and wanting to save it to zip file thru windows
> script. Is this possible?

This item slightly modified should be able to do it.

http://groups.google.com/group/microsoft.public.scripting.vbscript/ms...

I'm not sure you can copy all files in a folder at once. You may have to
loop through them.

I have modified the above somewhat.

Const MyZip = "C:\test.zip"
Const File1 = "C:\Data\test1.txt"
Const File2 = "C:\Data\test2.txt"

'-------------- create empty zip file ---------
CreateObject("Scripting.FileSystemObject") _
        .CreateTextFile(MyZip, True) _
        .Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar)

'-------------- zip the files ------------------
With CreateObject("Shell.Application")
        'add files
        .NameSpace(MyZip).CopyHere File1
        .NameSpace(MyZip).CopyHere File2
End With
wScript.Sleep 1000

LJB


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google