2013-01-02 55 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。运行(路径&程序) 您不需要在那里指定路径和程序。

相关问题