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

Answer Summary:
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
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1

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
Answered 05/02/2012 by: mpace
Red Belt

  • Or why not just run that on all machines regardless? If its not set, it will be. If it is no harm no foul.
Please log in to comment

Answers

0

I'm not a KBox user, but do you really need REG_DWORD? Isn't it sufficient with only DWORD?

Answered 05/02/2012 by: andemats
Second Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share