VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Create a new process using Win32_Process WMI class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Tue 11th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Create a new process using Win32_Process WMI class

Rate Create a new process using Win32_Process WMI class




Computer = "192.168.1.110"
Application = "C:\windows\system32\notepad.exe"
WorkDir = "c:\temp"
Set Process  = GetObject("winmgmts://" & Computer & "/root/cimv2:Win32_Process")
Set Method  = Process.Methods_("Create")
Set Param  = Method.inParameters.SpawnInstance_()
Param.CommandLine  = Application
Param.CurrentDirectory = WorkDir
Set Result = Process.ExecMethod_("Create", Param)
If Result.ReturnValue  = 0 Then
WScript.Echo "Create process method completed successfully"
Else
WScript.Echo "Create process method failed"
End If


Download this snippet    Add to My Saved Code

Create a new process using Win32_Process WMI class Comments

No comments have been posted about Create a new process using Win32_Process WMI class. Why not be the first to post a comment about Create a new process using Win32_Process WMI class.

Post your comment

Subject:
Message:
0/1000 characters