Search code examples
batch-fileregistry

Registry value for specific key


I have seen many answers to this general question but not sure how to incorporate the solutions to my batch... Can you help? I need the decimal value for this command/key:

reg query HKLM\Software\Wow6432Node\TeamViewer\Version9 /v ClientID

Solution

  • for /f "tokens=3" %%a in ('reg query HKLM\Software\Wow6432Node\TeamViewer\Version9 /v
     ClientID') do (set /a num = %%a)
    echo/%num%
    

    It will convert 0x..... to a decimal value. Don't forget to use %a instead of %%a if you are using cmd and not a batch file.