如何在VBScript中使用内部Windows XP选项解压缩文件

我想用VBScript解压一个.zip文件,只是它总是一台没有外部应用程序的新电脑。 现在我知道Windows XP和2003有一个内部的.zip文件夹选项,所以我想我可以通过VBScript使用它来提取文件。

我该怎么做?

我试过了:

Set objShell = CreateObject("Shell.Application") Set SrcFldr = objShell.NameSpace(fileName) Set DestFldr = objShell.NameSpace(appDir) DestFldr.CopyHere(SrcFldr) 

哪个没用 可能是什么问题呢?

只需设置ZipFile =压缩文件的位置,ExtractTo =将压缩文件提取到的位置即可。

 'The location of the zip file. ZipFile="C:\Test.Zip" 'The folder the contents should be extracted to. ExtractTo="C:\Test\" 'If the extraction location does not exist create it. Set fso = CreateObject("Scripting.FileSystemObject") If NOT fso.FolderExists(ExtractTo) Then fso.CreateFolder(ExtractTo) End If 'Extract the contants of the zip file. set objShell = CreateObject("Shell.Application") set FilesInZip=objShell.NameSpace(ZipFile).items objShell.NameSpace(ExtractTo).CopyHere(FilesInZip) Set fso = Nothing Set objShell = Nothing