我有這個批處理工作來設置一個sta IP和子網,然後回到dhcp,它在Vista中完美工作。然而,當試圖把它放到同事XP機器中,我得到了IF存在重命名的問題。 Vista的代碼: @echo off
cls
:start
if "%~n0"=="static" goto static
if "%~n0"=="dhcp" goto dhcp
echo Batch file MUST be
以下代碼在我的開發計算機中工作,我能夠看到服務使用netsh show urlacl註冊。 ProcessStartInfo netshPSI = new ProcessStartInfo();
// Windows XP SP3, Vista SP2, 7 SP1 or 8
netshPSI.FileName = "netsh.exe";