- @echo off
- setlocal enabledelayedexpansion
- set "mac=A0B0C0D0E0F0"
- set "reg=HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"
- set "str=0123456789ABCDEF"
-
- for /f "tokens=*" %%i in ('reg query "%reg%" /s /v /f "FlowControl" ^| findstr "{"') do (
- set "res="
- set /a x=n+=1
- for /L %%j in (1,1,12) do (
- set /a sum=0x!mac:~-%%j,1! + x, m=sum%%16, x=sum/16
- for %%k in (!m!) do (
- set "res=!str:~%%k,1!!res!"
- )
- )
- reg add "%%~i" /v "NetworkAddress" /d "!res!" /f
- )
- pause
复制代码
|