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?
how to save value of a data in regedit in a variable?
Moderator: DosItHelp
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
Re: how to save value of a data in regedit in a variable?
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
Regards
aGerman
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
Re: how to save value of a data in regedit in a variable?
sorry. i forgot...
name of the data is "InstallDir"
name of the data is "InstallDir"
Re: how to save value of a data in regedit in a variable?
Try that:
Regards
aGerman
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