Script Paradigm

プログラムを実行

指定したプログラムファイルを実行します。

以下の例ではWindows標準のアクセサリの電卓を起動します。

Option Explicit
Call sbExecuteFile("%SystemRoot%\System32\calc.exe","")
Sub sbExecuteFile(strFileName,strOption)
    Dim strCommand
    Dim objProcess
    
    strCommand = """" & strFileName & """" & " " & strOption
    Set objProcess = CreateObject("WScript.Shell")
    Call objProcess.Run(strCommand)
    Set objProcess = Nothing
End Sub
Copyright © 2006 Hikijishi All Rights Reserved.
[] [wsh][0.00116991996765137]