Robert
Robert

Reputation: 6437

Specify that a remote process created by wmi should interact with the desktop

I know I can create a remote process via WMI, something like:

        object[] theProcessToRun = { "notepad.exe" };
        var path = new ManagementPath(String.Format(@"\\{0}\root\cimv2", "win7test-hyperv"));
        var scope = new ManagementScope(path);
        var theClass = new ManagementClass(scope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
        theClass.InvokeMethod("Create", theProcessToRun);

But can I specify that should interact with the desktop (like psexec's -i)? I'd also like to be able to specify what user session the UI should interact with?

Upvotes: 0

Views: 653

Answers (1)

Anonimista
Anonimista

Reputation: 752

For security reasons the Win32_Process.Create method cannot be used to start an interactive process remotely.

Upvotes: 2

Related Questions