簡體   English   中英

無法在Win XP機器上運行netsh命令

[英]Not able to run netsh command in Win XP machine

我想使用以下代碼以編程方式Reserve the portport binding

private void PortReserve()
{
  try
   {
    System.Diagnostics.Process process = new System.Diagnostics.Process();
    System.Diagnostics.ProcessStartInfo startInfo = new           
    System.Diagnostics.ProcessStartInfo();
    startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
    startInfo.FileName = "cmd.exe";
    startInfo.UseShellExecute = true;
    startInfo.Arguments = @"/c netsh http add urlacl url=https://127.0.0.1:8083/ user=EVERYONE";
    process.StartInfo = startInfo;
    process.Start();

    }
    catch (Exception ex)
    {
      throw ex;
    }}

對於端口綁定:將startInfo.Arguments的參數替換為@"/c netsh http add sslcert ipport=127.0.0.1:8083 certhash=df03c4b0b32f3302a3b70abe6b5dfd864d0986a5 appid={00112233-4455-6677-8899-CCBBCCDDEEFF} clientcertnegotiation=enable";

以上命令在win 7win servers8台機器上完美win servers但是當涉及到Win xp它開始在CMD拋出一個錯誤: The following command was not found http add urlacl url=https://127.0.0.1:8083 user=Everyone

我檢查在所有machine成功導入mmc的證書。

在這種情況下我該怎么辦?

根據MSDN,你不能使用netsh與xp。

如果您運行的是Windows Server 2003或Windows XP,請使用HttpCfg.exe工具。 使用Windows Server 2003安裝此工具。 使用Windows XP,您可以在Windows XP Service Pack 2支持工具中下載該工具。 有關更多信息,請參閱Httpcfg概述。 Windows支持工具文檔說明了Httpcfg.exe工具的語法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM