
[已解決]批處理生成隨機MAC地址輸出的文本開頭都帶有一個口怎么能不帶口最后由 帝尊 于 -3-14 12:34
這里貼不上這個口,你們可以運行一下就知道了。nclick="copycode($('code0'));">復制代碼
- @echo off
- > Temp.txt call :MAC
- >> Temp.txt call :MAC
- (
- call :MAC
- call :MAC
- ) >>Temp.txt
- :MAC
- setlocal EnableDelayedExpansion
- cls
- set a=012345789ABCDEF
- set dew=26AE
- set /a d2=%random%%%3+1
- set /a b=%random%%%14+1
- set /a c=%random%%%14+1
- set /a d=%random%%%14+1
- set /a e=%random%%%14+1
- set /a f=%random%%%14+1
- set /a g=%random%%%14+1
- set /a h=%random%%%14+1
- set /a i=%random%%%14+1
- set /a j=%random%%%14+1
- set /a k=%random%%%14+1
- set /a l=%random%%%14+1
- set /a m=%random%%%14+1
- set MAC=!a:~%b%,1!!dew:~%d2%,1!-!a:~%d%,1!!a:~%e%,1!-!a:~%f%,1!!a:~%g%,1!-!a:~%h%,1!!a:~%i%,1!-!a:~%j%,1!!a:~%k%,1!-!a:~%l%,1!!a:~%m%,1!
- echo %MAC%
- exit /B

