且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在远程计算机上执行exe

更新时间:2021-12-18 22:48:42

答案是来自您的答复的组合.但是整个正确的解决方案是:

The answer was a combination from your replies. But the whole correct solution was:

        ProcessStartInfo info = new ProcessStartInfo("C:\\PsTools");
        info.FileName = @"C:\PsTools\psexec.exe";
        info.Arguments = @"\\" + serverName + @" -i C:\WINDOWS\notepad.exe";
        info.RedirectStandardOutput = true;
        info.UseShellExecute = false;
        Process p = Process.Start(info);