tags:

views:

62

answers:

2

Hi, My scenerio is connection to remote machine with C#.Net, and listing all processes with that remote computer. I can kill a process, or start a new process at remote. The problem is, when I execute a new process on remote, I can see the process on task manager, but it doesnt apeear on windows screen. Any idea why its not appearing on windows, but appearing on task manager/ process. Here is my execution code

private void btnStartNew_Click(object sender, EventArgs e)
    {
        object[] arrParams = { txtNewProcess.Text.Trim()};
        try
        {
            manageClass = new ManagementClass(myScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
            manageClass.InvokeMethod("Create", arrParams);
            btnConnect_Click(sender, e);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }

My Scope is :

myScope = new ManagementScope(@"\ROOT\CIMV2", connOptions);
A: 

Shouldn't the ManagementPath be something like \ComputerName\Root\CIMV2 instead of just \ROOT\CIMV2 ?

Radoslav Hristov
connOptions manage this. Think, I am in the computer. So I dont need type a computer name. Its working, just the problem is cant see the .exe which I started in UI
Serkan Hekimoglu
+2  A: 

the problem is about administrator permissions

emrahe