WMI Remote Notepad will not open

  • Thread starter Thread starter Patrick.Simons
  • Start date Start date
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)
 
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...
 
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
 
Back
Top