According to the help for REG.EXE ADD /?
the format of the registry path must start with either a computer name or one of five root key names:
REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]
KeyName [\\Machine\]FullKey
Machine Name of remote machine - omitting defaults to the
current machine. Only HKLM and HKU are available on remote
machines.
FullKey ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY.
If your KeyName value begins with \\
it will be treated as a computer name, otherwise REG.EXE expects one of the ROOTKEY values. Since your command does not begin the path with \\
REG.EXE expects one of the ROOTKEY values. Because Computer
is not one of those five values, you get the error:
ERROR: Invalid key name.
Type "REG QUERY /?" for usage.
You can fix your command by either removing the leading Computer\
from the path:
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa /v everyoneincludesanonymous /t REG_DWORD /d 1 /f
Or by specifying the computer name using the leading slashes:
reg add \\Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa /v everyoneincludesanonymous /t REG_DWORD /d 1 /f
Note: This assumes your computer name is actually "Computer". If it isn't provide its actual name.
3I would try removing the Computer\ part. – HelpingHand – 2018-09-25T19:21:06.773
Ill try this soon ty – Mark Deven – 2018-09-26T20:09:21.670
Forgot to tell you that that worked. Some PCs need \%computername%\HKEY... – Mark Deven – 2018-10-07T21:30:13.017