Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

permission denied

Posted on 2008-10-09
2
Medium Priority
?
969 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Assisted Solution

by:lodar123
lodar123 earned 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

705 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