我把代码编成一团了。现在成型是这样的。哈哈。乱了乱了。不过不管我怎么输入。都正确。请高看看哪有没有误。。
:OK
mode con cols=50 lines=15&color 2e
set aip=192.168.1.
set bip=192.168.2.
set cip=192.168.3.
set vip=192.168.4.
set mask=255.255.248.0
set gateway=192.168.4.254
set dns1=192.168.4.254
set dns2=61.130.254.34
:MENU
cls
echo.
echo.
echo A区 请按 1
echo.
echo B区 请按 2
echo.
echo C区 请按 3
echo.
echo V区 请按 4
echo.
echo.
echo.
:CHO
set /p key= 请输入您的选择(1,2,3,4):
if /i "%key%"=="1" goto A
if /i "%key%"=="2" goto B
if /i "%key%"=="3" goto C
if /i "%key%"=="4" goto V
echo.
echo 选择无效,请重新输入!...
echo.
goto cho
:A
cls
echo.
echo.
echo.
echo.
echo.
echo. A区
echo.
set /p num= 请输入计算机号:
echo.
if %num% GEQ 255 goto 255
:aa
if "%num:~0,1%" == "0" set num=%num:~1%&goto aa
set ip=%aip%%num%
set num=000%num%
set pcname=A%num:~-3%
cls
echo.
echo 计算机名:%pcname% IP地址:%ip%
pause
reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %pcname% /f >nul
reg add "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" /v ComputerName /t reg_sz /d %pcname% /f >nul
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %pcname% /f >nul
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %pcname% /f >nul
reg add "HKLM\SYSTEM\CurrentControlSet\Services\NwlnkIpx\Parameters" /v VirtualNetworkNumber /t REG_DWORD /d 0x00000%IP:~10% /f >nul
netsh interface ip set address name="本地连接" source=static addr=%ip% mask=%mask% >nul
netsh interface ip set address name="本地连接" gateway=%gateway% gwmetric=0 >nul
netsh interface ip set dns name="本地连接" source=static addr=%DNS1% register=PRIMARY >nul
netsh interface ip add dns name="本地连接" addr=%DNS2% index=2 >nul
reg add "HKLM\Software\iCafe8" /v ServIP /t reg_sz /d 192.168.4.221 /f >nul
reg add "HKLM\Software\iCafe8" /v ServPort /t reg_dword /d 9910 /f >nul
sc config MSiSCSI start= auto >nul
goto fjwblm
:255
echo 大于255啦...重新输入一次哇...
goto MENU
后面的就复制了...太长了...