简体   繁体   English

PsExec打开我的远程机器进程但应用程序没有启动

[英]PsExec open my remote machine process but application didn't start

I am using this code to open process in remote machine: 我正在使用此代码在远程机器中打开进程:

    Process process = new Process();
    ProcessStartInfo psi = new ProcessStartInfo(@"D:\tools\PsExec\PsExec.exe");
    psi.UseShellExecute = false;
    psi.RedirectStandardOutput = true;
    psi.RedirectStandardError = true;
    psi.RedirectStandardInput = true;
    psi.WindowStyle = ProcessWindowStyle.Minimized;
    psi.CreateNoWindow = true;
    psi.Arguments = "\\\\192.168.0.100 -u user-p pass D:\\app.exe";
    process.StartInfo = psi;
    process.Start();

on the remote machine i can see that the process start but i cannot see my Application GUI . 在远程机器上我可以看到进程启动但我看不到我的Application GUI

Double click on the exe will open the GUI 双击exe将打开GUI

在此输入图像描述

Try using psexec.exe with the -i switch : 尝试将psexec.exe-i开关一起使用:

psi.Arguments = "\\\\192.168.0.100 -i -u user -p pass D:\\app.exe";

or 要么

psi.Arguments = "\\\\192.168.0.100 -i 0 -u user -p pass D:\\app.exe";

use 1 instead of 0 if you are using vista or higher. 如果您使用的是Vista或更高版本,请使用1而不是0。 User desktop runs in session 1 in vista or higher. 用户桌面在vista或更高版本的会话1中运行。

您必须使用当前用户ID指定-i参数,默认情况下为0,以便获取当前记录的用户ID:quser / SERVER:remoteComputer,在我的情况下它返回2,因此,它是:-i 2我希望这个对你有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM