R.Wieser <add...@not.available> typed:
> My apologies, but I did use that ("set" I mean. I just forgot to type
> it into the message).
Ok
> And when I say "crash" I really do mean that: I get a message stating
> that "Microsoft (R) Console Based Scripting Host has encountered a
> problem and needs to close. We are sorry for the inconvenience".
> Thats not the script throwing an error, that is the OS (in my case
> XP) barfing. :-\
>
> I just tried to wait for a bit (half a second), but alas, that did not
> change the outcome.
I c, it is not supported to create an empty folder in a zip folder with
the explorer shell. This is a work around:
Const ssfPERSONAL = 5 ' Folder that contains user's documents.
Set fso = CreateObject("Scripting.FileSystemObject")
Set xpShell = CreateObject("Shell.Application")
Set xpZipFolder = xpShell.NameSpace("d:\path\MyFile.zip")
Set xpPersonal = xpShell.NameSpace(ssfPERSONAL)
xpPersonal.NewFolder "Test"
With fso.GetFolder(fso.BuildPath(xpPersonal.Self.Path, "Test"))
.CreateTextFile("Dummy").Close
End With
i = xpZipFolder.Items.Count
xpZipFolder.CopyHere xpPersonal.ParseName("Test")
Do Until xpZipFolder.Items.Count = i + 1
WScript.Sleep 16
Loop
Call fso.DeleteFolder(fso.BuildPath(xpPersonal.Self.Path, "Test"))
--
ЯR