- @echo off
- fltmc>nul||mshta vbscript:CreateObject("Shell.Application").ShellExecute("%~s0",,,"runas",1)(window.close)&&exit
- for /f "tokens=2 delims==" %%i in ('wmic path Win32_SoundDevice get name /value') do set /a n+=1&call echo, [%%n%%]%%i&call set _s%%n%%=%%i
- for /l %%i in (1,1,%n%) do call set c=%%c%%%%i
- CHOICE /C %c% /M "选择声卡"
- call set name=%%_s%errorlevel%%%
- for /f "tokens=2 delims==" %%i in ('wmic path Win32_SoundDevice where "name='%name%'" get PNPDeviceID /value') do set "pnpid=%%i"
- set "pnpid=%pnpid:amp;=%"
- CHOICE /C de /M "disable或enable"
- if %errorlevel% equ 1 pnputil /disable-device "%pnpid%"
- if %errorlevel% equ 2 pnputil /enable-device "%pnpid%"
- pause
复制代码
|