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

use*_*934 4 c# sysinternals

我正在使用此代码在远程机器中打开进程:

    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();
Run Code Online (Sandbox Code Playgroud)

在远程机器上,我可以看到该过程开始,但我看不到我的Application GUI.

双击exe将打开GUI

在此输入图像描述

jes*_*ter 5

尝试使用psexec.exe-i开关:

psi.Arguments = "\\\\192.168.0.100 -i -u user -p pass D:\\app.exe";
Run Code Online (Sandbox Code Playgroud)

要么

psi.Arguments = "\\\\192.168.0.100 -i 0 -u user -p pass D:\\app.exe";
Run Code Online (Sandbox Code Playgroud)

如果您使用的是Vista或更高版本,请使用1而不是0.用户桌面在vista或更高版本的会话1中运行.