|Thanks for this tutorial, it helped me a lot.|
I couldn't solve one problem.
I want to read a value for registry and assign it in a variable.
First I typed this:
Reg.exe QUERY "HKLM\Software\Try" /v "test" |Findstr.exe /ri "\<test\>"
Output: test REG_SZ C:\Program Files\Common Files
I want to copy "C:\Program Files\Common Files" in a variable.
So i tried this
For /f "tokens=3 delims= " %%a in ('Reg.exe QUERY "HKLM\SOFTWARE\try" /v "test" ^|Findstr.exe /ri "\<test\>"') do echo %%a
I tried token=3* also but it didn't worked.
I didn't tried "token=3-5" since value may differ in other system.
So, I need to copy all values after token 3.