2013-05-17 65 views

回答

3

是的,沒有。根據this answer on SO單獨使用VBscript是不可能的。

有VBA的方法來壓縮並使用內置 壓縮以及窗戶,這應該給一些有識之士至於 系統如何運作解壓。您可以將這些方法構建爲您選擇的 腳本語言。

但是,您可以使用「Windows外殼程序的執行相關的行爲」(同樣,來自同一來源的引用)

Dim fso, winShell, MyTarget, MySource, file 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set winShell = createObject("shell.application") 


MyTarget = Wscript.Arguments.Item(0) 
MySource = Wscript.Arguments.Item(1) 

Wscript.Echo "Adding " & MySource & " to " & MyTarget 

'create a new clean zip archive 
Set file = fso.CreateTextFile(MyTarget, True) 
file.write("PK" & chr(5) & chr(6) & string(18,chr(0))) 
file.close 

winShell.NameSpace(MyTarget).CopyHere winShell.NameSpace(MySource).Items 

do until winShell.namespace(MyTarget).items.count = winShell.namespace(MySource).items.count 
    wscript.sleep 1000 
loop 

Set winShell = Nothing 
Set fso = Nothing 
相關問題