Advertisement
FlyFar

Random MAC Adress Generator (Need Install hex2dec.exe from Microsoft)

Oct 21st, 2021
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.60 KB | None | 0 0
  1. REM Random MAC adress generator
  2. ::Use UFT-8 Encoding
  3. chcp 65001
  4. echo off
  5. cls
  6. title Random MAC Adress Generator (RMAG)
  7. color 0a
  8. mode con: cols=50 lines=8
  9. :MacGenStart
  10. REM Check for hex2dec
  11. hex2dec
  12. if %errorlevel%==9009 (
  13.     title Random MAC adress generator - ERROR
  14.     call :missingHex2dec
  15.     goto :eof
  16. ) else (
  17.     cls
  18. )
  19. REM Starting generating MAC
  20. echo -== Random MAC adress Generator ==-
  21. echo.
  22. call :macgenerator
  23. REM Check for 0x error
  24. if %genMAC:~0,1%==x (goto MacGenStart) else (
  25.     if %genMAC:~0,2%==0x goto MacGenStart
  26. )
  27. REM End of check
  28. echo Your generated MAC adress is:
  29. echo ┌──────────────────┐
  30. echo │#%genMAC:~0,2%-%genMAC:~2,2%-%genMAC:~4,2%-%genMAC:~6,2%-%genMAC:~8,2%-%genMAC:~10,2%
  31. echo %genMAC% | clip
  32. echo └──────────────────┘
  33. echo And it has been copied to your clipboard.
  34. pause
  35. REM End of Main Menu
  36. goto MacGenStart
  37. :macgenerator
  38. for /f "tokens=* usebackq" %%f in (`hex2dec %random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%%random:~-1%`) do (
  39.     set genMAC=%%f
  40. )
  41. set genMAC=%genMAC:~-12%
  42. goto :eof
  43. :missingHex2dec
  44. cls
  45. mode con: cols=63 lines=7
  46. echo ERROR!
  47. echo.
  48. echo hex2dec.EXE not found in "PATH" directory...
  49. echo To get this program, go to website:
  50. echo.
  51. echo https://technet.microsoft.com/en-us/sysinternals/bb896736.aspx
  52. echo.
  53. choice /c yn /m "Do you want to open this link now? "
  54. if %errorlevel%==1 start https://technet.microsoft.com/en-us/sysinternals/bb896736.aspx
  55. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement