When querying the registry from a batch file, can I query the Data?

前端 未结 3 1041
梦如初夏
梦如初夏 2020-12-10 03:32

I have the following query -

@ECHO OFF
REG QUERY \"HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft Games\\Flight Simulator\\10.0\" /v AppPath
PAUSE
         


        
3条回答
  •  温柔的废话
    2020-12-10 04:10

    Bellow command does work, For example I want to get OS name :

    for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^| findstr "REG_"') do @echo %%b
    

    The output is :

    Windows 10 Enterprise
    

提交回复
热议问题