Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have the following query -

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

This returns the Name, Type, and Data of the entry, as below -

HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0
    AppPath    REG_SZ    C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\

Press any key to continue . . .

Is it possible to retrieve only the Data section of a registry entry?

like image 854
user2755744 Avatar asked Oct 25 '13 04:10

user2755744


1 Answers

for /f "tokens=2*" %%a in ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0" /v AppPath') do set "AppPath=%%~b"
echo %AppPath%
pause
like image 135
Endoro Avatar answered Oct 14 '22 18:10

Endoro