Page 1 of 1
how to save value of a data in regedit in a variable?
Posted: 25 Aug 2011 09:29
by Mohammad_Dos
in this key in regedit:
HKLM "SOFTWARE\Eset\ESET Security\CurrentVersion\Info"
there is a data(reg_sz). i want to save value of this data in a variable. how to do that?
Re: how to save value of a data in regedit in a variable?
Posted: 25 Aug 2011 13:23
by aGerman
What is the name of the value where you want to save the data (or is it the "no name" default value which exists in each key)?
Regards
aGerman
Re: how to save value of a data in regedit in a variable?
Posted: 25 Aug 2011 14:15
by Mohammad_Dos
sorry. i forgot...
name of the data is "InstallDir"
Re: how to save value of a data in regedit in a variable?
Posted: 25 Aug 2011 14:20
by aGerman
Try that:
Code: Select all
@echo off &setlocal
for /f "tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Eset\ESET Security\CurrentVersion\Info" /v "InstallDir"') do set "data=%%b"
echo %data%
pause
Regards
aGerman