Das folgende Beispiel zeigt wie man auf einem entferntem System Prozesse mittels VB Script und WMI ausführt.
'Execute remote process
strComputer ="YourComputer"
strDomain = "YourDomain"
strUser = "YourUser"
strPassword = "YourPassword"
strCMDLine = "C:\Windows\Notepad.exe C:\Boot.ini"
strCMDDir = "C:\Windows"Set
objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer(strComputer,"root\CIMV2",strUser,strPassword,"MS_409","ntlmdomain:" + strDomain)
Set objShare = objWMIService.Get("Win32_Process")
Set objInParam = objShare.Methods_("Create").inParameters.SpawnInstance_()
objInParam.Properties_.Item("CommandLine") = "C:\Windows\Notepad.exe C:\Boot.ini"
objInParam.Properties_.Item("CurrentDirectory") = "C:\Windows"
Set objOutParams = objWMIService.ExecMethod("Win32_Process", "Create", objInParam)
Wscript.echo "ProcessId: " & objOutParams.ProcessId
Wscript.echo "ReturnValue: " & objOutParams.ReturnValue