Windows XP Forums


Reply
Thread Tools Display Modes

WMI provider method terminates after creation

 
 
Krishna Chaitanya
Guest
Posts: n/a
 
      13th August 2009
Hi,
I have to use a combination of alternative username/password
credentials and remote process creation and fetching its output on
termination. So I can't use the moniker style GetObject as it doesn't
support alternative username.

Am using the following code, but it creates the process, gives me the
PID but when I RDC to that remote machine, I don't see that PID in
the
task manager. What could be wrong? Please help me. The following code
is taken largely from the MSDN link http://msdn.microsoft.com/en-us/libr...33(VS.85).aspx

--------------*-------------*------------------
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer("192.168.1.34","root
\cimv2","Administrator","password")
service.Security_.ImpersonationLevel = 3

Set process = service.Get("Win32_Process")
Set inparams = process.Methods_("Create").InParameters.SpawnInsta nce_
inparams.Properties_.Item("CommandLine") = "Notepad.exe"

Set outparams = process.ExecMethod_("Create",inparams)

If Error = 0 Then
WScript.Echo "Process created with PID of " &
outparams.ProcessId
End If
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RPC terminates unexceptively?? Jackie Windows XP Help and Support 4 6th January 2004 02:00 AM
RPC terminates unexpectedly dariusblue@hotmail.com Windows XP Performance 2 20th November 2003 07:30 PM
RPC terminates, pc shuts down haldun kufluoglu Windows XP Networking 3 21st August 2003 08:52 PM
rpc service terminates Belinda Green Windows XP General 0 14th August 2003 08:47 PM


All times are GMT. The time now is 05:08 PM.
Windows XP Forums is an independent website and is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26