How to get the data of a registry value in batch

2

I'm trying to get the value of Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\everyoneincludeanonymous. I've tried using Reg Query but no matter what I type it says "INVALID KEY NAME". Here is what I have tried:

REG QUERY Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\everyoneincludeanonymous /s
Reg Query "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' /v everyoneincludeanonymous`

But they all reply "INVALID KEY NAME".

I'm running Windows 10 Home.

Mark Deven

Posted 2018-08-28T12:47:05.907

Reputation: 1 101

Answers

2

Converting my comment to an answer.

The syntax Reg query /? or visit ss64.com/nt/reg.html requires the computer/machine name to be preceeded with a double backslash.

So:

Reg Query "\\Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' /v everyoneincludeanonymous

should do.

LotPings

Posted 2018-08-28T12:47:05.907

Reputation: 6 150