远程流程执行 [英] Remote Process Execution

查看:138
本文介绍了远程流程执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之情况是连接到远程机器C#.NET,并列出与远程计算机上的所有进程。我可以杀死一个进程,或远程启动一个新的进程。问题是,当我执行一个新的进程上的遥控器,我可以看到在任务管理器的过程中,但它不apeear在Windows画面。任何想法,为什么它没有出现在窗口,但出现在任务管理器/进程。这是我执行code

 私人无效btnStartNew_Click(对象发件人,EventArgs的)
    {
        [对象] arrParams = {txtNewProcess.Text.Trim()};
        尝试
        {
            manageClass =新ManagementClass(的MyScope,新ManagementPath(Win32_Process的),新ObjectGetOptions());
            manageClass.InvokeMethod(创建,arrParams);
            btnConnect_Click(发件人,E);
        }
        赶上(例外前)
        {
            的MessageBox.show(ex.ToString());
        }
    }
 

我的范围是:

 的MyScope =新的管理范围(@\ ROOT \ CIMV2,connOptions);
 

解决方案

这个问题是有关管理员权限

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);

解决方案

the problem is about administrator permissions

这篇关于远程流程执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆