I am trying to check and update the network zone mapping in the registry from the Command Prompt. I need to check for the value named
*. For example, under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\cmich.local, Registry Editor shows the following:
* REG_DWORD 0x00000001 (1)
To check this value in a command script (*.cmd), I have been attempting to use the REG QUERY command. When I attempt to do so by passing
* as the value to match, the REG QUERY command treats the asterisk as a wildcard and returns a match as long as the key exists.
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\example.com" /v "*" /reg:64
I've tried numerous combinations of escape characters (even those that I was pretty sure wouldn't work), including all of the following with and without quotation marks:
!*. None of these worked.
I also need to add and remove values with the name
*, presumably with REG ADD and REG DELETE.
How do I add, remove, and test for the existence of a registry value with the name
* at the Command Prompt?