我在这里关注了一些文章,并设法在远程计算机上启动notepad.exe
。
我正在尝试启动我们在远程计算机上购买并安装在远程计算机上的第三方软件,但该软件无法运行exe。
object[] theProcessToRun = { @"C:\Program Files (x86)\xyz\xyz.exe" };
var connection = new ConnectionOptions
{
Username = "username",
Password = "password",
Authority = ""ntlmdomain:.local"",
};
var scope = new ManagementScope("\\\\IP\\root\\CIMV2", connection);
scope.Connect();
using (var managementClass = new ManagementClass(scope, new ManagementPath("Win32_Process"), new ObjectGetOptions()))
{
managementClass.InvokeMethod("Create", theProcessToRun);
}