Yes, I see what the problem is now. How stupid of me to miss that. Because the data is null/empty/blank, the $ReturnValue = $RegData therefore will always return ? "Registry value already applied"
I need to modify the code for this one to check if $RegValue exists, if not writevalue, then on subsequent logins check what $RegData equals.
A - Noted
B - Noted as above
C - I will add 0 $Rc = WriteValue(). Didn't realise it was required. But I will put that into my UDF file.
D - I never knew when parentheses were required, so just generally added them and Kixtart forgives me! I will put this onto my project list to go through the coding (which is now considerably leaner simpler than it used to be). So shouldn't be a problem to remove parentheses that are not required.
E - Are you referring to ? "Registry value already applied" returns. This is usually remmed out and only made available during debugging when I am having a problem getting code to work as expected? Or is this related to point C - which I will fix.
F - I will look into this as you are correct, I should declare variables for each function.
ShaneP - the problem wasn't as I thought with the writevalue command. I neglected to realise that because the data value is blank, my udf function code always returned the result - ? "Registry value already applied" For this particular registry addition, I need to check if the regvalue "OverrideFirstRunPage" exists as well as checking the return of the regdata.
|