WMI Process Call Create gives good feedback but doesn't work

I'm developing a VB.NET application able to control remotely other computers, send commands and retrieve information
Here's the code:
Dim connOptions As ConnectionOptions = New ConnectionOptions()
connOptions.Impersonation = System.Management.ImpersonationLevel.Impersonate
connOptions.Authentication = System.Management.AuthenticationLevel.Packet
connOptions.EnablePrivileges = True
Dim theScope As ManagementScope = New ManagementScope("\\" & IPAddressTextBox.Text & "\root\cimv2", connOptions)
Dim theClass As New ManagementClass(theScope, New ManagementPath("Win32_Process"), New ObjectGetOptions())
Dim iPe As ManagementBaseObject = theClass.GetMethodParameters("Create")
iPe("CommandLine") = CommandLineTextBox.Text
theClass.InvokeMethod("Create", iPe, Nothing)
The problem is that even if it gives a "0" ReturnValue, which means the operation is successful, the process doesn't actually starts on the remote machine (which is in the local network)  
In reality, the process actually starts but doesn't show up, in the Task Manager of the remote machine, is visible ONLY under "Processes" -> "Show processes from all users", at this point, i can see the process i created from the other
main machine, the process "User Name" is the main computer username, and not the remote machine one, is that the problem?
I'm using Impersonate as the impersonation level and Packet as the Authentication level (as you can see from the code), is this what i'm doing wrong?
also it doesn't work with WMIC with "wmic /NODE:IPADDRESS process call create COMMANDLINE"
Thanks you for your time.
 

It doesn't matter whether you use VB, VBScript, or PowerShell. If you use any of these languages to create a process on a remote machine using WMI, the new process is always going to run in the background. You cannot make it run as a visible process. This
is by design and is explicitly stated in the Remarks section of the method's documentation:
http://msdn.microsoft.com/en-us/library/aa389388.aspx
For security reasons the Win32_Process.Create method cannot be used to start an interactive process remotely.
-- Bill Stewart [Bill_Stewart]

Similar Messages

Maybe you are looking for

  • Delivery completed indicator is not tick on generic article

    Hello Expert, I create a normal purchase order with  generic article and variants. Then, I do goods receipt with full quantity. Delivery completed indicator is automatic set 'X' on variant items. But with generic article, Delivery completed indicator

  • Specifying a circle with 2 mouse presses

    Hi, I'm trying to create an applet that allows the user to specify a circle with 2 mouse presses. I'd like the 1st point to represent the circle's centre and the 2nd to be any point on the periphery. Creating a mouse press event handler is a given ob

  • Can the Audigy 2 ZS support 2 speakers systems at on

    I have my new media center PC set up with the 5. analog system up, running and sounding great. Does anyone know if it is possible to run a second set of speakers (digital speakers via the digital output) at the same time in adjacent room?

  • How to restore demo database

    Hi all, I've a demo database (OEC Computers) 2007 B compatible.  Can anyone please guide me how to restore the database.  Since I don't have knowledge regarding SQL Server, I'm not able to restore the demo database.  Please guide me to restore the de

  • Applescript Support for Airplay?

    Does anyone know if there is direct support for controlling Airplay speakers in iTunes via Applescript? I know there are hacks to select the desired Airplay speaker using keypreses and manipulation of the speakers via the iTunes UI. However, this isn