This requires 10 points.
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Originally posted by pan163 at 2007-11-30 01:10 PM:
Good stuff,,, There is a question, what software or tool is used to read the MAC and IP address? Change them one by one manually???
@Echo off
Title Collect your machine's computer name.IP.MAC to prepare for auto-changing IP when burning discs by Bin QQ43142691
For /f "tokens=16" %%a in ('ipconfig/all^|find /i "Host Name"') do (set PcName=%%a)
For /f "tokens=15" %%i in ('ipconfig^|find /i "ip address"') do (set ip=%%i)
For /f "tokens=12" %%b in ('ipconfig/all^| find /i "Physical Address"') do (set mac=%%b)
if not exist new.ini goto new
For /f "tokens=3" %%m in ('type new.ini^|find /i /n "%mac%"') do (set fm=%%m)
if not "%fm%"=="" exit
:ok
Echo.%PcName% %ip% %mac% >>new.ini
Exit
:new
Echo.**********Start collecting*******>>new.ini
goto ok
@echo off
color 0a
call :getme "ip address" "ip"
call :getme "Physical Address" "mac"
call :getme "Default Gateway" "gateway"
goto begin
:getme
for /f "tokens=2 delims=:" %%i in ('ipconfig /all^|findstr /i /c:%1') do if not "!%~2!" == "" set "%~2=%%i"
goto :eof
:begin
echo -%ip%-%mac%-%gateway%-
pause
exit