|  | 
| <br />原帖由 <i>xiaoy</i> 于 2011-11-4 23:10 发表 <a href="http://bbs.wuyou.net/redirect.php?goto=findpost&pid=2332063&ptid=201990" target="_blank"><img src="http://bbs.wuyou.net/images/common/back.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" /></a><br />现在的问题是在精简系统上,我的代码根本就不管用,没有获得,在正常的系统上可以获得,不知是哪里出错了。但它又能获得IPCONFIG/all的上半部分的内容。<br />
 谢谢你的方法,现在没有在办公室,不能再试,明天再说了。
 复制代码
@ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "DELIMS=" %%I IN ('IPCONFIG /ALL') DO (
        CALL :A "%%I"
        
)
rem 绑定本机IP, mac
arp -s !eIP! !eMAC!
echo.以下网卡己经绑定了
arp -a
GOTO :EOF
:A
SET "A=%~1"
IF DEFINED A  IF NOT "!A:~0,1!"==" " SET "B=!A:~0,1!"
FOR /F "TOKENS=1,2* DELIMS=:. " %%A IN ("%~1") DO (
        IF /I %%A_%%B==PHYSICAL_ADDRESS SET "!B!MAC=%%C"
        IF /I %%A_%%B==IP_ADDRESS       SET "!B!IP=%%C"
        IF /I %%A_%%B==SUBNET_MASK      SET "!B!MASK=%%C"
        IF /I %%A_%%B==DEFAULT_GATEWAY  SET "!B!WG=%%C"        
        IF /I %%A_%%B==DNS_SERVERS        SET "!B!DNS=%%C"
)
goto :eof
 | 
 |