### Fully Automatic Machine Number and IP Setting Tool
Haha, after half a month of study, my first big work is finally completed!!!
Put it up to share with colleagues in the internet café industry. If everyone thinks it's useful, give the little brother some points as an encouragement, hehehe :D
For more complete functions, please see:
http://www.cn-dos.net/forum/viewthread.php?tid=26870&fpage=7&highlight=&page=2
Automatic IP Change Version 2.0
http://www.cn-dos.net/forum/viewthread.php?tid=28621&fpage=2
Fully Automatic Machine Number and IP Setting Tool Version 3.0 (Full Version)
http://www.cn-dos.net/forum/viewthread.php?tid=32490&fpage=4
ip.bat
MAC.ini
DNS.ini
Just modify MAC.ini and DNS.ini according to your actual requirements. :P
[ Last edited by qasa on 2007-8-5 at 02:45 PM ]
Haha, after half a month of study, my first big work is finally completed!!!
Put it up to share with colleagues in the internet café industry. If everyone thinks it's useful, give the little brother some points as an encouragement, hehehe :D
For more complete functions, please see:
http://www.cn-dos.net/forum/viewthread.php?tid=26870&fpage=7&highlight=&page=2
Automatic IP Change Version 2.0
http://www.cn-dos.net/forum/viewthread.php?tid=28621&fpage=2
Fully Automatic Machine Number and IP Setting Tool Version 3.0 (Full Version)
http://www.cn-dos.net/forum/viewthread.php?tid=32490&fpage=4
ip.bat
@set dbg=
@echo %dbg% off&setlocal enabledelayedexpansion
:: code by qasa copyright@qknet 2:16 2007-1-19
title Fully Automatic Machine Number and IP Setting Tool Author:qasa
set no_=0
mode con cols=40 lines=10&color fc
for /f "tokens=12 delims= " %%i in ('ipconfig /all^|find /i "Physical Address"') do (
set mac=%%i
set mac=!mac:~0,-1!
)
for /f "tokens=1-3 delims==|" %%j in (MAC.INI) do (
set mac_=%%j
set ip_=%%k
set sm_=%%l
if !mac! equ !mac_! (
call :set_ !mac_! !ip_! !sm_!
set /a no_+=1
)
)
if "!no_!"=="0" (
echo.&echo There is no MAC address of this machine in MAC.ini, and it will be sent to the work machine......
echo %date% %time% Newly discovered MAC address:>>NewMAC.ini&echo !mac! >>NewMAC.ini
echo.&echo Has been sent to the work machine! ! !
)
start shutdown -r -t 40
echo.
set/p zz_= Press Q key to exit the shutdown state:
if /i !zz_! equ q (start shutdown -a)
ping/n 5 127.1>nul
exit /b
:set_
echo %1 %2 %3
set yy_=%3
echo.&echo Is setting IP and machine number for %yy_:~1,3% number...... Please wait
for /f "tokens=1-4 delims==|" %%e in (DNS.ini) do (
set dns1_=%%e
set dns2_=%%f
set workgate_=%%g
set zwym_=%%h
)
for /l %%w in (1,1,2) do (
netsh interface IP Set Address "Local Area Connection" Static %2 %zwym_% %workgate_% 1 >nul
)
netsh interface IP Set Dns "Local Area Connection" static %dns1_% >nul
netsh interface ip add dns "Local Area Connection" %dns2_% >nul
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName /v "ComputerName" /t REG_SZ /d %3 /f >nul 2>NUL
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v "ComputerName" /t REG_SZ /d %3 /f >nul 2>NUL
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v "Hostname" /t REG_SZ /d %3 /f >nul 2>NUL
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v "NV Hostname" /t REG_SZ /d %3 /f >nul 2>NUL
echo.&echo Setting completed
goto :eofMAC.ini
00-0A-EB-21-A7-EC=192.168.0.5|-005
00-E0-4C-8F-11-4A=192.168.0.6|-006
00-0A-EB-A0-1D-9A=192.168.0.7|-007
00-40-05-14-E7-C9=192.168.0.8|-008
00-0A-EB-A0-1C-7A=192.168.0.9|-009
00-0D-87-F2-03-50=192.168.0.10|-010
00-0D-87-F2-A3-5C=192.168.0.11|-011DNS.ini
202.96.128.86=202.96.128.186|192.168.0.1|255.255.255.0Just modify MAC.ini and DNS.ini according to your actual requirements. :P
[ Last edited by qasa on 2007-8-5 at 02:45 PM ]
Recent Ratings for This Post
( 11 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| redtek | +9 | 2007-01-19 21:38 |
| hsting | +2 | 2007-01-20 07:06 |
| lxmxn | +4 | 2007-01-20 07:09 |
| everest79 | +4 | 2007-01-20 13:40 |
| 561808275 | +1 | 2007-01-21 04:15 |
| 429499381 | +1 | 2007-01-24 15:03 |
| htysm | +2 | 2007-02-15 22:46 |
| oilio | +3 | 2007-02-25 00:22 |
| ran520 | +1 | 2007-03-01 10:32 |
| colorphoto | +2 | 2007-05-03 09:57 |
| lzmuhioin | +1 | 2007-10-05 20:36 |
Attachments
κχυμγνξοθπρωψιαδλεηφβτζσ┬╀┾┳┞┯┰┱┣┲┳╂╁│├┟┭┠这是什么??这就是我的人生
