Reputation: 399
I tried to add registry but If I take user prompt input the the variable is stored instead of a value
@echo off
set /p RName="Enter the registry name:"
set /p Rvalue="enter the value:"
REG ADD HKEY_CURRENT_USER\Console /v RName /d RValue
REG QUERY HKEY_CURRENT_USER\Console /v RName
Pause
So RName and RValue is inserted instead of entered value entered by user at prompt
Upvotes: 0
Views: 306
Reputation: 399
I resolved it By add padding variable with % wherever it has been used.
@echo off
set /p RName="Enter the registry name:"
set /p Rvalue="enter the value:"
REG ADD HKEY_CURRENT_USER\Console /v %RName% /d %RValue%
REG QUERY HKEY_CURRENT_USER\Console /v %RName%
Pause
Upvotes: 1