elserpiente
asked on
How to read registry value of dir path inside batch file
Hi all
I need to get variable with path of Firebird isntallation
i created bat file with code:
FOR /F "tokens=3* " %%i IN ('reg query "HKEY_LOCAL_MACHINE\SOFTWA RE\Firebir d Project\Firebird Server\Instances" /v "DefaultInstance"') DO @echo %%i
unfortunately path is with space characters. Below the result of reg execution:
C:\>reg query "HKEY_LOCAL_MACHINE\SOFTWA RE\Firebir d Project\Firebird Server\Instances" /v "DefaultInstance"
HKEY_LOCAL_MACHINE\SOFTWAR E\Firebird Project\Firebird Server\Instances
DefaultInstance REG_SZ C:\Program Files (x86)\Firebird\Firebird_2_ 0\
SO i need the result at the end of code like that FBDIR="C:\Program Files (x86)\Firebird\Firebird_2_ 0\"
I need to get variable with path of Firebird isntallation
i created bat file with code:
FOR /F "tokens=3* " %%i IN ('reg query "HKEY_LOCAL_MACHINE\SOFTWA
unfortunately path is with space characters. Below the result of reg execution:
C:\>reg query "HKEY_LOCAL_MACHINE\SOFTWA
HKEY_LOCAL_MACHINE\SOFTWAR
DefaultInstance REG_SZ C:\Program Files (x86)\Firebird\Firebird_2_
SO i need the result at the end of code like that FBDIR="C:\Program Files (x86)\Firebird\Firebird_2_
correction - use a semi-colon:
FOR /F "tokens=3*; delims="
FOR /F "tokens=3*; delims="
ASKER
I need to read path of FB into variable
now at example above it reads only C:\Program Files instead of C:\Program Files (x86)\Firebird\Firebird_2_ 0\
now at example above it reads only C:\Program Files instead of C:\Program Files (x86)\Firebird\Firebird_2_
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
FOR /F "tokens=3*,delims="