SHARE
TWEET

Edit audio configuration using CMD (Batch) [Fixed]

Imthedude025 May 7th, 2018 (edited) 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. ::Edit audio configuration using CMD W/H GUI!                ::
  3. ::Created by RU$$ [http://russdev.mooo.com/]                 ::
  4. ::FIXED on 5/8/2018 - Fixed issue with reg perms             ::
  5. ::CREDIT - https://goo.gl/qPqApY                             ::
  6. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. @echo off
  8. title Edit audio configuration using CMD
  9.  
  10. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11. :: Main Menu
  12.  
  13. :MENU
  14. cls
  15.  
  16. ::List
  17. echo CURRENT ADRESS LIST:
  18. echo =======================================================
  19. powershell.exe -nologo -noprofile -command "Get-ChildItem -Path hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render"
  20. echo =======================================================
  21. echo KEY VALUE MAP:
  22. echo 1 - Active
  23. echo 2 - Disabled
  24. echo 4 - Not present
  25. echo 8 - Unplugged
  26. echo.
  27.  
  28. SET INPUT=
  29. SET /P INPUT= Select an entry to modifiy:
  30.  
  31. GOTO :REG
  32. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  33. :: SUB EXPLORER
  34.  
  35. :REG
  36. cls
  37.  
  38. ::List
  39. echo KEY NAME:
  40. echo =======================================================
  41. FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\%INPUT%\Properties" /v "{b3f8fa53-0004-438e-9003-51a46e139bfc},6"') DO set "DFMT=%%B"
  42. ECHO %DFMT%
  43. echo =======================================================
  44. echo.
  45. echo KEY VALUE 0x(VALUE):
  46. echo =======================================================
  47. FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\%INPUT%" /v "DeviceState"') DO set "DFMT=%%B"
  48. ECHO %DFMT%
  49. echo =======================================================
  50. echo.
  51. echo Options:
  52. echo [1] Go back to audio list
  53. echo.
  54.  
  55. ::Menu
  56. SET INPUT2=
  57. SET /P INPUT2= Change this device status to:
  58.  
  59. IF /I '%INPUT2%'=='' GOTO :REG
  60. IF /I '%INPUT2%'=='1' GOTO :MENU
  61.  
  62. GOTO :SET
  63.  
  64. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  65. :: KEY PERMS & MODS
  66.  
  67. :SET
  68. cls
  69. Echo Changing keys value..
  70. Echo.
  71.  
  72. ::Grant perms to REG
  73. echo \Registry\machine\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\%INPUT% [7] >> "%~dp0KeyPermx.txt"
  74. REGINI %~dp0KeyPermx.txt
  75. del %~dp0KeyPermx.txt
  76.  
  77. ::Change Key
  78. reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\%INPUT%" /f /v DeviceState /t REG_DWORD /d %INPUT2%
  79. Echo.
  80. pause.
  81.  
  82. GOTO :REG
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top