Is it possible to modify a registry entry via a .bat/.cmd script?

前端 未结 8 974
萌比男神i
萌比男神i 2020-12-04 12:12

Is it possible to modify a registry value (whether string or DWORD) via a .bat/.cmd script?

8条回答
  •  日久生厌
    2020-12-04 12:34

    Yes, you can script using the reg command. Example:

    reg add HKCU\Software\SomeProduct
    reg add HKCU\Software\SomeProduct /v Version /t REG_SZ /d v2.4.6
    

    This would create key HKEY_CURRENT_USER\Software\SomeProduct, and add a String value "v2.4.6" named "Version" to that key.

    reg /? has the details.

提交回复
热议问题