Esecuzione di programmi esterni

Creato il: 14.07.2015
Option Explicit
 
Function Run (ByVal cmd)
  On Error Resume Next
  Dim sh
  Dim wsx
  Set sh = CreateObject("WScript.Shell")
  Set wsx = Sh.Run(cmd)
  Run = wsx.ExitCode
End Function
 
Run "notepad.exe"


In alternativa, se e' installata WSH 5.6 o superiore si puo' utilizzare il metodo Exec:

Set wsx = Sh.Exec(cmd)

Login