Guest User

Untitled

a guest
Nov 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. :: Mac Options adder
  2. :: Mac Options adder
  3. :: Author: muink
  4.  
  5. @echo off&title Mac Options adder&color 3f
  6. :Main
  7. setlocal enabledelayedexpansion
  8. set Class=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class
  9. set Network=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network
  10. set GUID={4D36E972-E325-11CE-BFC1-08002BE10318}
  11. set DEVcount=
  12. :FindDevices
  13. cls
  14. echo.Searching devices...
  15. for /f %%i in ('reg query %Class%\%GUID%') do (
  16. echo."%%i"|find /i "\%GUID%\" >nul 2>nul&&(
  17. echo."%%i"|find /i "\Properties" >nul 2>nul||(
  18. for /f "tokens=1-3" %%j in ('reg query %%i /v DeviceInstanceID') do (
  19. echo."%%l"|findstr /i "PCI\\ USB\\" >nul 2>nul&&(
  20. rem true
  21. set /a DEVcount+=1
  22. set "Net!DEVcount!_Path=%%i"
  23. for /f "delims=" %%m in ('reg query %%i /v DriverDesc 2^>nul') do set "Net!DEVcount!_Name=%%m"
  24. for /f "delims=" %%m in ('reg query %%i /v NetCfgInstanceId 2^>nul') do set "NetCfgID=%%m"
  25. for /f "delims=" %%m in ('reg query %Network%\%GUID%\!NetCfgID:~34!\Connection /v Name 2^>nul') do set "Internet!DEVcount!_Name=%%m"
  26. ) ) ) ) )
  27.  
  28. :ChoiceDevices
  29. cls
  30. set TableHead=Number Connection Name Device Name
  31. echo.%TableHead%
  32. for /l %%i in (1,1,%DEVcount%) do echo.[%%i] !Internet%%i_Name:~22! !Net%%i_Name:~28!
  33. echo.&set /p ChoiceID= Please enter the NIC number you want to operate:
  34. if not defined ChoiceID goto ChoiceDevices
  35. set /a ChoiceID=%ChoiceID%&if %ChoiceID% equ 0 goto ChoiceDevices
  36. if not %ChoiceID% geq 1 if %ChoiceID% leq %DEVcount% goto ChoiceDevices
  37. ping /n 5 127.0.0.1>nul
  38.  
  39. :SetMacOptions
  40. cls
  41. echo.
  42. set OptionsName=Network Address
  43. set /p OptionsName= Custom name for added option (Default is "Network Address"):
  44.  
  45. :AddMacOptions
  46. (reg add !Net%ChoiceID%_Path!\Ndi\Params\NetworkAddress /v ParamDesc /d "%OptionsName%" /f
  47. reg add !Net%ChoiceID%_Path!\Ndi\Params\NetworkAddress /v Default /f
  48. reg add !Net%ChoiceID%_Path!\Ndi\Params\NetworkAddress /v Optional /d 1 /f
  49. reg add !Net%ChoiceID%_Path!\Ndi\Params\NetworkAddress /v Type /d edit /f
  50. reg add !Net%ChoiceID%_Path!\Ndi\Params\NetworkAddress /v LimitText /d 12 /f
  51. reg add !Net%ChoiceID%_Path!\Ndi\Params\NetworkAddress /v UpperCase /d 1 /f) >nul 2>nul
  52.  
  53. :Done
  54. cls&echo.&echo.ALL DONE...
  55. ping /n 5 127.0.0.1>nul
  56.  
  57. :END
  58. exit
Add Comment
Please, Sign In to add comment