我有这个批处理工作来设置一个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";