I need to inspect the regkeys under hklm\system\currentcontrolset\control\print\monitors\standard tcp/ip port\ports*
each key under will have a value named “snmp enabled”. I need to have the fixlet to be relevant whenever “snmp enabled = 1”. The problem is that all of the keys under “ports” are dynamic.
Once I determine what is relevant, I need an action that will set the value “snmp enable” to 0.
q: (items 1 of (values whose (name of it is “SNMP Enabled” and it is 1) of it, names of it) of keys of key “hklm\system\currentcontrolset\control\print\monitors\standard tcp/ip port\ports” of registry)
Here is an Action Script that uses the aforementioned relevance to change the registry settings:
delete __appendfile
delete snmp_enabled.reg
appendfile Windows Registry Editor Version 5.00
appendfile
appendfile {("[HKEY_LOCAL_MACHINE\system\currentcontrolset\control\print\monitors\standard tcp/ip port\ports\" & it & "]" & "%0d%0a" & "%22SNMP Enabled%22=dword:00000000" & "%0d%0a%0d%0a") of (items 1 of (values whose (name of it is "SNMP Enabled" and it is 1) of it, names of it) of keys of key "hklm\system\currentcontrolset\control\print\monitors\standard tcp/ip port\ports\" of registry)}
move __appendfile snmp_enabled.reg
wait regedit /s snmp_enabled.reg