
CODE: [Copy to clipboard]@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in ('ipconfig/all ^|findstr /i /c:" Physical Address"') do (
for /f "tokens=2 delims=:" %%a in ("%%i") do (
set a=%%a
set a=!a: =!
)
for /f "tokens=1-3 delims= " %%a in (min.txt) do (
if /i "!a!"=="%%a" (
netsh interface ip set address name=本地连接 source=static addr=%%b mask=255.255.255.0
wmic computersystem where "name='%computername%'" call rename "%%c"
wmic computersystem where Name="%computername%" call JoinDomainOrWorkgroup name="mshome"
)
)
)
pause
CODE: [Copy to clipboard]是你要的结果吧?for /f "tokens=2 delims=:" %%i in ('ipconfig /all ^|findstr /i /c:"physical address"') do set a=%%i
set a=%a: =%
for /f "tokens=1,2* delims= " %%m in (c:\min.txt) do if %a%==%%m (netsh interface ip set address name=本地连接 source=static addr=%%n mask=255.255.255.0
wmic computersystem where "name='%computername%'" call rename "%%o"
wmic computersystem where Name="%COMPUTERNAME%" call JoinDomainOrWorkgroup Name="MSHOME")
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |