- @echo off
- setlocal enabledelayedexpansion
- (for /f "tokens=1-6 delims=- " %%a in ('getmac ^| findstr "..-..-..-..-..-.."') do (
- echo %%a%%b%%c%%d%%e%%f
- ))>a.txt
-
- :input
- set /p strMAC=请输入一个MAC地址(输入EOF退出):
- if "!strMAC!" equ "" (
- goto :input
- ) else if "!strMAC!" equ "EOF" (
- goto :end
- ) else (
- call :check
- goto :input
- )
- goto :eof
-
- :check
- findstr "!strMAC!" a.txt >nul 2>&1 && echo 一致 || echo 不一致
- goto :eof
-
- :end
- pause
复制代码
|