Execute process remotely with WMI (VBScript)

How can I start a process and then wait until that process quits before terminating the script?

It offers the capability to execute process with the limitation of not allowing any user interaction – the process will run in the background without showing any interface on user’s session, which is a perfect feature for running non-interactive processes.

WMI, below is the code snippet in VBScript:

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
intReturn = objWMIService.Create("command", Null, Null, intProcessID)

Reference: http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec06/hey1208.mspx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s