Solved

permission denied

Posted on 2008-10-09
2
958 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

13 Experts available now in Live!

Get 1:1 Help Now