I need to query under a registry key for a hostname from among 20 hosts, then replace the hostname with a new host from a list of 20 replacements based on what host is found.
I am working on a software distribution package that uses "If search(registry..." for each of the 20 original hostnames. Within the "If" statement is a "BEGINREGISTRY" statement querying the key, then replacing to hostname-based values.
I'm using the first option for "If search(registry," "Read data value a specific registry value by key and value name." The statements look like this:
IF SEARCH(Registry, "HKEY_LOCAL_MACHINE\SOFTWARE\Vendor\Application", "Host1", "$APPHOST1$")
KEY: query, "HKEY_LOCAL_MACHINE\SOFTWARE\Vendor\Application"
VALUE: reg_sz, replace, "NetworkDir", "\\newhost01\appdata"
VALUE: reg_sz, replace, "RemoteHost", "newhost01"
There are 20 of these searches for hosts 1-20. The search is not working and I'm lost at this point. Can someone give me a hint at what I need to change (option for the search, structure of my commands, etc.). It seems this is the way to go for my package so I'm anxious to get some answers.