Pedro Sales
Pedro Sales

Reputation: 553

Set variables in batch file with registry values

I'm going To explain what I want because I really don't know how to get it done ... In a batch file, I want to set some variables with registry values, for example,

\hklm\software\teste
    Test1   REG_SZ   c:\teste1
    Test2   REG_SZ   c:\teste2
    .....

And in the batch file

Test1=c:\test1
Test2=c:\test2
......

Upvotes: 0

Views: 1068

Answers (1)

Rafael
Rafael

Reputation: 3112

Try this

for /f "tokens=1,3" %%a in ('reg query hklm\software\teste') do (
 set "%%~a=%%~b"
)

echo/%valueName%

Upvotes: 1

Related Questions