How can I get the value of a registry key from within a batch script?

前端 未结 17 2609
抹茶落季
抹茶落季 2020-11-27 15:12

I need to use a REG QUERY command to view the value of a key and set the result into a variable with this command:

FOR /F \"tokens=2* delims=    \" %%A IN (\         


        
17条回答
  •  天涯浪人
    2020-11-27 15:24

    To get a particular answer to the registry value you may use the following query:

    REG QUERY "Key_Name" /v "Value_Name" /s

    eg: REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v "EnableExtensions" /s

    here /v : Queries for a specific registry key values.

    /s : Queries all subkeys and values recursively (like dir /s)

提交回复
热议问题