Open keteague opened 4 years ago
I'm not sure what this helps. To run either of the upgrade or install the WMF hotfix requires you to be an administrator so you should have access to the HKLM
hive. The purpose of not auto filling the RunOnce keys is to allow the user to handle the reboot themselves and not populate the reg keys with a plaintext credential. I'm not comfortable with the scripts always populating those keys if the user has not specified any credentials to do so.
If the script is run without admin priv's, I get this:
If the script has to run again after a reboot, you must specify the -username and -password args. Typically, username would be the same user that is currently logged in when the script is first run.
Remove -username and automatically fill it in with the current user that's logged in. Remove -password and have it prompt for the password in a dialog box or user input at the command line.
Replace: $reg_key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
With: $reg_key = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"