UAC Set Registry as DWORD
Hello,
I am by no means a pro when it comes to scripting. As I understand it, I should be able to verify and set registry keys through the KBOX scriptiong module, I am having some troubles setting them correctly. I am trying to turn on and off Windows 7 UAC. Every time I try to run the script, instead of setting the value to a DWORD, it sets the value as a string. Has anyone else seen this issue?
Here is my KScript.
Verify a registry value exists...
Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Name: EnableLUA
Verify a registry value is exactly...
Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Name: EnableLUA
Equal to: 1
On Success
Set a registry value...
Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Name: EnableLUA
Type: REG_DWORD
Data: 0
Thanks for your help,
Brad
Answers (2)
I would have it run this command on success: reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
I would have it run this command on success:
reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
Comments:
-
Or why not just run that on all machines regardless? If its not set, it will be. If it is no harm no foul. - dchristian 12 years ago