i admit this isn't pretty, but i have to have this done by next Tuesday. In psuedo code it goes like this:
1. Check for a registry key
2. If not there, write it
3. If that key has a value, get it
4. Append new value to old value
5. Write new value to registry key
6. Tell everyone it was successful (or not)
In my code it looks like:
Code:
DIM $Key2Find, $LSAValue, $AddValue
$Key2Find = "HKEY_Local_Machine\System\CurrentControlSet\Control\LSA"
$LSAValue = ""
$AddValue = "passfilter|"
:CheckKey
$RK = KeyExist("$Key2Find")
IF $RK <> 0
$LSAValue = ReadValue("$Key2Find", "Notification Packages")
? "LSAValue = $LSAValue"
Else
$LSAValue = WriteValue("$Key2Find", "Notification Packages", "$LSAValue" + "$AddValue", "REG_MULTI_SZ")
? "LSAValue = $LSAValue"
Endif
GoTo CheckValue
get $x
:CheckValue
? "Write new registry value?"
Get $x
If $x == "Y" or $x == "y"
$x = InStr("$LSAValue", "passfilter")
If $x = 0
$Rc = WriteValue("$Key2Find", "Notification Packages", "$LSAValue"+"$AddValue", "REG_MULTI_SZ")
If @Error = 0
? "Value written to registry"
? "New $Key2Find value: $LSAValue"
Endif
Else
? "Proper string already written..."
? "$LSAValue"
get $y
Endif
Endif
Get $x
i was never very good at writing functions, though i can take other's functions and make them fit my needs.
Comments greatly appreciated!
Thanks,
Dave