if (( not exists “Enabled” of key “strKey” of registry) or (value “Enabled” of key “StrKey” as string is not “0”))
{
regset “strKey” “Enabled”=dword:00000000
}
above script for checking the key! if name of the key “Enabled” is not located in registry and or the second control for value of “Enabled”… if Enabled value is not “0” then i want to apply value “1”
note: if it is not possible writing the all code only on action and if needs to use relevance. Please write me the Action and Relevance code…
You want to learn relevance and actionscript, so I am not giving you the answer, just some hints about where you have issues with your script.
Firstly, regset needs its parameters in the same format that a .reg file would use:
The hive name must be in the long format, not the abbreviated form
The key name must be contained within square brackets
Relevance can use either long or abbreviated hive names, but does not have the key name contained within square brackets, so your use of a variable is generally to be applauded, but needs some modification here.
You have recognised that ‘Enabled’ is a value in part of your ‘if’ statement, but only in part of it, but the format of your relevance in the ‘if’ statement is generally wrong.
You say that if ‘Enabled’ is not “0” then you want to set it to “1”, but your script appears to be setting the wrong value and using the wrong type.
However, first off you need to get your relevance correct so that it returns ‘true’ or ‘false’ - at the moment it is going to return an error which is not acceptable in the substitution.
It worked below RELEVANCE and ACTION scripts in my own task… what is the correct writing way for repeated action? for example;
I have applied regset four times… how can i apply the while , loop condition or only once apply regset for 4 registry values?
MY RELEVANCE::
(
(
not exists values "DisabledByDefault"
whose( ( pad of (it as string as version) ) = “1” )
of keys "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client"
of (x64 registries; x32 registries))
or
(
not exists values "Enabled"
whose( ( pad of (it as string as version) ) = “0” )
of keys "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client"
of (x64 registries; x32 registries))
or
(
not exists values "DisabledByDefault"
whose( ( pad of (it as string as version) ) = “1” )
of keys "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server"
of (x64 registries; x32 registries))
or
(
not exists values "Enabled"
whose( ( pad of (it as string as version) ) = “0” )
of keys "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server"
of (x64 registries; x32 registries))
)