C# 我需要帮助在远程机器上用c同步Performance

C# 我需要帮助在远程机器上用c同步Performance,c#,perforce,wmi-service,C#,Perforce,Wmi Service,您好,我希望能够使用C从另一台服务器以编程方式同步构建服务器上的Performance。 服务器A上有EXE。 服务器B具有性能 我在这两台机器上都有管理员权限 我想用像这样的东西 System.Diagnostics.Process.Start("p4 sync", "\"" + path + @""" -f //release/production/...") 我有电脑连接 ManagementScope scope = new ManagementScope("\\\\" + compu

您好,我希望能够使用C从另一台服务器以编程方式同步构建服务器上的Performance。 服务器A上有EXE。 服务器B具有性能

我在这两台机器上都有管理员权限

我想用像这样的东西

System.Diagnostics.Process.Start("p4 sync", "\"" + path + @""" -f //release/production/...")
我有电脑连接

ManagementScope scope = new ManagementScope("\\\\" + computer_name + "\\root\\cimv2");

scope.Connect();
我不知道如何把这一切放在一起。
任何帮助都将不胜感激。谢谢你

我想起来了:

public static void perforce_sync()
    {

        string computer_name = @"server_name";
        ManagementScope scope = new ManagementScope("\\\\" + computer_name + "\\root\\cimv2");
        scope.Connect();
        ObjectGetOptions object_get_options = new ObjectGetOptions();
        ManagementPath management_path = new ManagementPath("Win32_Process");
        ManagementClass process_class = new ManagementClass(scope, management_path, object_get_options);
        ManagementBaseObject inparams = process_class.GetMethodParameters("create");
        inparams["CommandLine"] = @"p4 sync -f //release/...";
        ManagementBaseObject outparams = process_class.InvokeMethod("Create", inparams, null);
        Console.WriteLine("Creation of the process returned: " + outparams["returnValue"]);
        Console.WriteLine("Process ID: " + outparams["processId"]);

    }