WMI Remote Notepad will not open

P

Patrick.Simons

The following VB6-Code shout remotely open notepad. Instead the process
is created on the remote-PC but notepad remains invisible.

Any ideas??

Const SW_SHOW = 5

Dim oWMIService As Object
Dim oStartup As WbemScripting.SWbemObject
Dim oConfig As Object
Dim oProcess As Object

Set oWMIService = GetObject
("winmgmts:impersonationLevel=impersonate}!\\" _
& sRemotePC & "\root\cimv2")

Set oStartup = oWMIService.Get("Win32_ProcessStartup")
Set oConfig = oStartup.SpawnInstance_
oConfig.ShowWindow = SW_SHOW

Set oProcess = oWMIService.Get("Win32_Process")
iErrRc = oProcess.Create(sProcess, Null, oConfig, iProcessID)
 
T

Torgeir Bakken \(MVP\)

The following VB6-Code shout remotely open notepad. Instead
the process is created on the remote-PC but notepad remains
invisible.

Any ideas??

(snip)
Hi,

That is as expected, you will not be able to use the
Win32_Process.Create method to launch a visible process on a
remote computer. This limitation is done for security reasons...
 
P

Patrick.Simons

Ok, but is there another way to do this? I known that Sysinternals.com
has a program called psexec.exe (in PsTools) which can do it. So there
should be a way.

Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top