我正在使用此代码在远程机器中打开进程:
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

尝试使用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中运行.
| 归档时间: |
|
| 查看次数: |
8210 次 |
| 最近记录: |