Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

Windows XP Compressed (Zip) Folder Object

閲覧: 1 回
最初の未読メッセージにスキップ

John Smith

未読、
2002/09/11 6:45:042002/09/11
To:
I want to create an object that is a .ZIP file under Windows XP which calls
them Compressed Folders
Do I create a Shell object of an Application object?
How do I find out the Class?
Can I Create an object by GUID?

Thanks in advance


Michael Harris (MVP)

未読、
2002/09/11 19:21:382002/09/11
To:
John Smith wrote:
> I want to create an object that is a .ZIP file under Windows XP which
> calls them Compressed Folders


WMI's Win32_Directory object supports a Compress method. I don't have access to an XP box, so I can't try it out to see if that's what you are after.


> Do I create a Shell object of an Application object?
> How do I find out the Class?

Set oShellApp = CreateObject("Shell.Application")

> Can I Create an object by GUID?
>

The <object> element in the WSF or WSC file format supports a GUID reference.

<object id="objID" [classid="clsid:GUID" | progid="progID"] events="true|false"/>

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US


Torgeir Bakken

未読、
2002/09/11 20:21:282002/09/11
To:
"Michael Harris (MVP)" wrote:

> John Smith wrote:
> > I want to create an object that is a .ZIP file under Windows XP which
> > calls them Compressed Folders
>
> WMI's Win32_Directory object supports a Compress method. I don't have access to an XP box, so I can't try it out to see if that's what you are after.

Hi

It does the same in WinXP as it does on a Win2k computer, it does a folder or file compress, same as if you right click on it and select Properties and
then "Advanced".

Here is a script Alex supplied earlier:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * from Win32_Directory where name = 'c:\\f2'")
For Each objFolder in colFolders
errResults = objFolder.Compress
If errResults = 0 Then
Wscript.Echo "Folder compressed sucessfully"
Else
Wscript.Echo "Error # " & errResults
End If
Next


--
torgeir


John Smith

未読、
2002/09/13 5:42:042002/09/13
To:
Well that certainly works, however it's a true NTFS compressed folder not a
Compressed (Zipped) Folder (Why the hell didn't MS just call them .ZIP
files?)

What I'm really trying to do is...
1. created an empty .ZIP file
2. Which I Rename
3. Then Open
4. Open my data folder
5. Send Keys to Select all, then copy all
6. Close my data foler
7. Past them into my TodaysDate.zip file

I can do steps 2 through 7 :-)
But I can't preform Step 1.

I thought a
oFSO.CreateFolder("E:\Documents and Settings\John\Desktop\Test.zip")
But that doesn't make a .ZIP file, it just makes a folder

I thought a
Set ZipObject = setObject("E:\Documents and Settings\John\Desktop\Fred.zip")
or if you can
Set wordApp = CreateObject("Word.Application")
then why can't you
Set ZipObject = setObject("Zip.Application")
Or similar...

Hence my question how do I find out the Class?


Can I Create an object by GUID?

Maybe I can do something like
Set ZipObject = setObject("{888DCA60-FC0A-11CF-8F0F-00C04FD7D062}")
And that would create (and open?) a .ZIP file?


"Torgeir Bakken" <Torgeir.B...@hydro.com> wrote in message
news:3D7FDE08...@hydro.com...

Torgeir Bakken

未読、
2002/09/13 9:12:332002/09/13
To:
John Smith wrote:

Hi

I think you will have to install either a command line based program or a
ActiveX component to do this from a script, ven on WinXP...


ZipGenius has a command line interface (freeware)
http://www.zipgenius.it/


WinZip Command Line Support Add-On
http://www.winzip.com/wzcline.htm

PowerArchiver has a command line version as well:
http://www.powerarchiver.com


Here is a couple of COM components:

Polar ZIP
http://www.polarsoftware.com/products/zip/index.html

DynaZIP:
http://www.innermedia.com/Products/Zip-compression/zip-compression.htm

Alternatively, you can make a CAB file instead:

From: Torgeir Bakken (Torgeir.B...@hydro.com)
Subject: Re: create a cab file
Newsgroups: microsoft.public.scripting.jscript
Date: 2002-07-16 20:03:35 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3D34DC2F.DD931369%40hydro.com


--
torgeir


メッセージは削除されました

John Smith

未読、
2002/09/16 5:41:502002/09/16
To:
You are right, However the Command line Zipper don't have a progress Bar...
I'm about to zip 600 - 800 Mbyte of Data so i can then write it to my CDRW.

It'd be kinda nice to watch it going down.

I also think that there MUST actually be a way to do it without 3rd party
utils
Indeed the first 4 byts of a new zip file are
"PK" & CHR$(5) & CHR$(6)
The file is only 22 bytes long.

If I could write 22 Bytes to a binary file (not text) I would also be able
to win.
Can we write to a Binary file from WSH (I only see info about text streams).

Or

If I could preform a right click and choose New, Compressed (Zipped) Folder
I would also be okay...

Thanks

"Christoph Basedau" <cb_no...@gmx.net> wrote in message
news:altkr8$9l9$06$1...@news.t-online.com...
>
> "John Smith" <spamfree@don'tbother.com> schrieb:


>
> > What I'm really trying to do is...
> > 1. created an empty .ZIP file
> > 2. Which I Rename
> > 3. Then Open
> > 4. Open my data folder
> > 5. Send Keys to Select all, then copy all
> > 6. Close my data foler
> > 7. Past them into my TodaysDate.zip file
> >
> > I can do steps 2 through 7 :-)
> > But I can't preform Step 1.
>

> It's easier + faster zipping with commandline-zippers like
> wzzip (from winzip) or pkzip or winrar then searching
> COMCompressor-GUIDS.
>
>
> folder = "C:\Archiv\Daily\"
> zip = "D:\Sys\Pack\WinZip\wzzip.exe -pa "
>
> today = year(date) & "-" & r2("month") & "-" & r2("day")
> file = folder & today & ".zip "
> source = folder & "*.*"
>
> MsgBox "returncode zipping """ & Folder & """: " & vbCr & _
> CreateObject("Wscript.Shell").run (zip & file & source,1,-1)
>
> function r2(s): execute "r2=right(0 & " & s & "(date),2)": end function

Paul Randall

未読、
2002/09/17 23:55:492002/09/17
To:
John,
Search for some examples in this newsgroup or the vbscript newsgroup for
examples of the ADO textstream object. It is very scriptable and not
text-centric.
-Paul Randall

"John Smith" <spamfree@don'tbother.com> wrote in message
news:#TtBmUWXCHA.2544@tkmsftngp12...

新着メール 0 件