本帖最后由 kidzgy 于 2022-6-7 14:55 编辑
已知注册表项:HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration,项下有多个三级目录,每个【Scaling】的整数值当为3的时候,表示全屏游戏时为扩充全屏(即不留黑边),整数值为4的时候,表示为比例全屏(即留左右黑边)。现有一个想法,欲通过批处理实现来回切换。
如图所示,首先我们称【Configuration】为根目录,根目录下的【一级目录】为混合字母数字的随机名称,每个【二级目录】的名称必有【00】、或有【01】,每个【三级目录】的名称必有【00】、或有【01】。
【Scaling】整数值在三级目录下,为3或4。
如果我通过下面代码即可实现路径【一级目录\00\00】的注册表值更改,但是无法具体针对到【00\01】【01\00】的注册表值。当然,如果硬要加上【一级目录\00\01】、【一级目录\01\00】也不是不可以,只是添加了几个注册表垃圾。- @echo off
- rem 3为扩充全屏(不留黑边)
- rem 4为比例全屏(留黑边)
- set "key=HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration"
- for /f "delims=" %%i in ('reg query %key%') do (
- reg add "%%i\00\00" /f /v "Scaling" /t REG_DWORD /d 4
- )
- pause
复制代码 试问:如何精确地再修改到对于可能存在【00】【01】的二级或三级目录下的Scaling值?
针对根目录,导出的注册表值为(已剔除无关要素):- Windows Registry Editor Version 5.00
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\MSBDD_NOEDID_8086_5912_00000000_00020000_0^B08740C2BFF214D42D46B3A10A98A6BA\00\00]
- "Scaling"=dword:00000003
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\MSNILNOEDID_1414_008D_FFFFFFFF_FFFFFFFF_0^030B4FCE00727AC1593E5B6FD18648D6\00\00]
- "Scaling"=dword:00000003
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E*XMD00021_0F_07E0_46^4D8DDDD6E25E4BDE2B94E5DFF11EE407\00\00]
- "Scaling"=dword:00000003
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E*XMD00021_0F_07E0_46^4D8DDDD6E25E4BDE2B94E5DFF11EE407\00\01]
- "Scaling"=dword:00000004
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E*XMD004A1_06_07E3_04^E2F6FE76B12A0D275F9A55FF2025AF3C\00\00]
- "Scaling"=dword:00000003
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E*XMD004A1_06_07E3_04^E2F6FE76B12A0D275F9A55FF2025AF3C\00\01]
- "Scaling"=dword:00000004
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E+XMD00021_0F_07E0_46^CB58B188A5CF30EAC37679DEA22A6977\00\00]
- "Scaling"=dword:00000003
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E+XMD00021_0F_07E0_46^CB58B188A5CF30EAC37679DEA22A6977\01\00]
- "Scaling"=dword:00000004
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E+XMD004A1_06_07E3_04^FADE41BB7FB9C81047368C07118D695A\00\00]
- "Scaling"=dword:00000003
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E+XMD004A1_06_07E3_04^FADE41BB7FB9C81047368C07118D695A\01\00]
- "Scaling"=dword:00000004
-
- [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\GraphicsDrivers\Configuration\SDC49520_00_07DE_2E^05EF7AB21157FED8EC108446C5DE0BAE\00\00]
- "Scaling"=dword:00000003
复制代码
|