One option would be to define scheduled task that runs at system startup and executes a Powershell script.
Here's a sample script that will save the registry value when it starts and will reset it if it ever changes. You will need to modify it to refer to the registry value that you need to monitor.
Function LogIt($msg) {
"{0} - {1}" -f (Get-Date), $msg | Write-Host
"{0} - {1}" -f (Get-Date), $msg | Out-File -FilePath $log -Append
}
# Define the log file name and the registry to monitor
$log = "c:\scripts\Monitor.log"
$KeyName = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\"
$ValueName = "UpdateDesiredVisibility"
LogIt "Monitor starting."
$wur = Get-ItemProperty $KeyName
$DesiredValue = $wur.($ValueName)
LogIt "Initial value is $DesiredValue"
while ($true) { # infinite loop to monitor value
Start-Sleep -Seconds 60
$wur = Get-ItemProperty $KeyName
if ($wur.($ValueName) -ne $DesiredValue) {
Logit "Value changed to $($wur.UpdateDesiredVisibility). Reset to $DesiredValue."
Set-ItemProperty $KeyName -Name $ValueName -Value $DesiredValue
}
}
Run the task as the system account identity so that it executes "in the background". If you need to stop it, use the task manager to kill the Powershell process.