New
#1
Batch file help. For loop not working...
What im trying to accomplish:
-I want to REG QUERY a registry entry that will output the value of a (*SpeedDuplex) string value
-I then want to store that value in a variable
The command im using and the output:
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007" /v *SpeedDuplex
Output:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BF
C1-08002BE10318}\0007
*SpeedDuplex REG_SZ 0
End of search: 1 match(es) found.
My batch file looks like this:
@echo off
for /f "skip=2 tokens=3 delims= " %%R in ('REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007" /v *SpeedDuplex') do (
set "reg_value=%%R"
)
echo %reg_value%
Output of %reg_value%: which if you notice is the third word in the last line?
Search:
Tried changing the skip and tokens with no luck and im racking my brain because it looks correct to me. Anyway if anyone can point me in the right direction I would appreciate it. Thanks in advance and lets play some Destiny :)