0
RDP运行本地程序有没有办法通过RDP运行本地程序 类似的东西:C#中通过使用PSEXEC
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.FileName = @"G:\PSTools\PsExec.exe";
p.StartInfo.Arguments = @"\\tsclient calc.exe";
p.Start();
string output = p.StandardOutput.ReadToEnd();
string errormessage = p.StandardError.ReadToEnd();
p.WaitForExit();
在这种情况下,我得到:
的句柄无效。连接到软件tsclient ......无法访问软件tsclient
感谢
请更具体地说明你想做什么。现在我将它理解为“我想从本地机器上的远程机器运行程序”。你确定这是你想说的吗? – Nico
你正试图在远程机器上运行某些东西,那么为什么要通过RDP? psexec正是为你做的。如果“tsclient”是远程计算机的名称,那么这将起作用。另外删除cmd.exe,只需直接调用calc.exe(或任何你想要的程序),否则它将无法工作。也许你需要完整的路径名称到你的.exe –