Solved

permission denied

Posted on 2008-10-09
2
959 Views
Last Modified: 2012-06-21
i am using following to change value of enableLUA , but every time i run code it gives eror of permission denied. pls check why it is happening like this . kindly edit code as required.
Dim oSheluac, valuac
 

Private Function KeyExists (keyName)

	Dim bKey

		

	On Error Resume Next

 

	bKey = oSheluac.RegRead(keyName)

 

	If TypeName (bKey) = "Empty" Then

		KeyExists = False

	Else

		KeyExists = True

	End If

End Function

 

 

Set oSheluac = CreateObject("Wscript.Shell")

 

If keyExists("HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA") Then

	wscript.echo "Value exists"

 valuac = osheluac.RegRead ("HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA" )

	if valu <> 0 Then 

	osheluac.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", 0, "REG_DWORD"

			wscript.echo "The value have been changed."
 

	End If 

Else 

End If

Open in new window

0
Comment
Question by:ankur3020
2 Comments
 
LVL 5

Assisted Solution

by:lodar123
lodar123 earned 50 total points
ID: 22677618
make sure you have access to modify that registry key
0
 

Accepted Solution

by:
ankur3020 earned 0 total points
ID: 22679707
thanks i got the error.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike scripting languages such as C# where a semi-colon is used to indicate the end of a command, Microsoft's VBScript language relies on line breaks to determine when a command begins and ends. As you can imagine, this quickly results in messy cod…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now