2013-01-02 54 views

回答

8
'Objects 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set shl = CreateObject("WScript.Shell") 

path="C:\SomeFolderToExist\" 'path to folder  
exists = fso.FolderExists(path) 

if (exists) then 
    program="myprog.exe" 'Program name to run 
    shl.Run(path & program) 'Run a program 
end if 

location.Thanks對於解壓,我只能告訴你看到這樣的:Extract files from ZIP file with VBScript

+0

我試過,但它不工作FSO設置=的CreateObject( 「Scripting.FileSystemObject的」) 設置SHL =的CreateObject( 「WScript.Shell」) PATH = 「C:\ SYSTEM TOOLS \」 已存在= fso.FolderExists(路徑) If(Exists)Then program =「HWMonitor.exe」 shl.Run(「C:\ SYSTEM TOOLS \ HWMonitor.exe」) End If – user1635949

2

更換shl.Run( 「C:\ SYSTEM TOOLS \ HWMonitor.exe」)與:SHL。運行(路徑&程序) 您不需要在那裏指定路徑和程序。

相關問題