标题: [注册表类] 【已解决】批处理判断注册表的数值数据,谢谢 [打印本页]
作者: yyz219 时间: 2023-6-23 08:56 标题: 【已解决】批处理判断注册表的数值数据,谢谢
完美解决了:
... ...- ::【重启声卡】
- Pecmd.exe kill 龙卷风收音.exe >nul 2>nul
- D:\1绿色软件\刷新托盘图标.exe >nul 2>nul
- :A %【禁用声卡】%
- devcon disable *DEV_1C20* >nul 2>nul
- ::【检测是否禁止成功:即注册表中有无"0x1"(成功跳到:B,不成功跳到:A】
- reg query "HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\HDAUDIO\FUNC_01&VEN_8086&DEV_2805&SUBSYS_80860101&REV_1000\4&3AD7007D&0&0301" /v "CSConfigFlags" | find "0x1" >nul
- if %errorlevel% equ 0 (goto :B) else goto :A
- ::***********************************************************************************************************
- :B %【启用声卡】%
- devcon enable *DEV_1C20* >nul 2>nul
- devcon enable *DEV_1C20* >nul 2>nul
- ::【检测是否启用成功:即注册表中 有无"0x0"(成功跳到:C,不成功跳到:B】
- reg query "HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\HDAUDIO\FUNC_01&VEN_8086&DEV_2805&SUBSYS_80860101&REV_1000\4&3AD7007D&0&0301" /v "CSConfigFlags" | find "0x0" >nul
- if %errorlevel% equ 0 (goto :C) else goto :B
- :C
- ::***********************************************************************************************************
- start "" "%~dp0默认音量.vbs"
- start "" "%~dp0键盘灯.exe"
- : D
- exit
复制代码
作者: smss 时间: 2023-6-23 10:26
本帖最后由 smss 于 2023-6-23 10:36 编辑
你这只有2种状态- @echo off
- for /f "tokens=3 delims= " %%i in ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\HDAUDIO\FUNC_01&VEN_8086&DEV_2805&SUBSYS_80860101&REV_1000\4&3AD7007D&0&0301" /v "CSConfigFlags"')do if %%i==0x1 (echo goto :A)else echo goto :B
- pause
复制代码
- @echo off
- for /f "tokens=3 delims= " %%i in ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\HDAUDIO\FUNC_01&VEN_8086&DEV_2805&SUBSYS_80860101&REV_1000\4&3AD7007D&0&0301" /v "CSConfigFlags"')do (
- if %%i==0x1 (echo goto :A
- )else (
- if %%i==0x0 (echo goto :C)else echo goto :D
- )
- )
- pause
复制代码
作者: yyz219 时间: 2023-6-23 11:19
你这只有2种状态
smss 发表于 2023-6-23 10:26
我试一试 谢谢
作者: yyz219 时间: 2023-6-23 11:22
你这只有2种状态
smss 发表于 2023-6-23 10:26
帮我看看下面,是否正确?谢谢
******************************
@echo off
reg query "HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\HDAUDIO\FUNC_01&VEN_8086&DEV_2805&SUBSYS_80860101&REV_1000\4&3AD7007D&0&0301" /v "CSConfigFlags" | find "0x1" >>nul
if %errorlevel% equ 0 (goto :B) else goto :A
:B
echo.
echo.
echo 是
pause>nul
exit
:A
echo.
echo.
echo 否
pause>nul
exit
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |