Put this one in your utilities scripts to include when needed:
Sub Run(ByVal sFile) Dim shell Set shell = CreateObject("WScript.Shell") shell.Run Chr(34) & sFile & Chr(34), 1, false Set shell = Nothing End Sub
Then to use it include the script and call it as follows:
' Execute the file MyFile.exe Run "C:Program FilesMyFile.exe"
Or, use it to execute a file in the app that is registered to handle files of that type:
' Open the file MyFile.doc in Word Run "C:My DocumentsMyFile.doc"