Link to home
Start Free TrialLog in
Avatar of ankur3020
ankur3020

asked on

turn off uac

vbs code to turn off UAC in vista
SOLUTION
Avatar of si_shamil
si_shamil
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ankur3020
ankur3020

ASKER

i need to change the status with vbs,pls provide code.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i tested the code whenever i ran it , just a message display "Enable/Disable/Status" nothing else.

do you want me to create a dword with name enable LUA and assign it value 0 for disable and 1 for enable UAC.

otherwise please explain the above code
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can i run the above code with vbs for disabling uac.?
Yes the last snippet will disable the UAC.
You will have to restart the computer after you run the script for changes to take effect.
following code is ok for enabling uac?
Const UAC_ENABLE = 1
Const UAC_REGKEY = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA"
 
Set Shell = CreateObject( "WScript.Shell" )
Shell.RegWrite UAC_REGKEY, UAC_ENABLE, "REG_DWORD"
Wscript.Echo "UAC enabled, please reboot..."

Open in new window

yes it is!
dear when uac is turned on , i tried to run uac turning off script i.e. vbs file . it gave message permission denied. then how will it turn off uac when system do not allow to run file.
You have to run this script as administrator, only with administrative permissions you can disable/enable UAC for all users
i tried to change registry value with uac enable, but still getting same error of permission denied. u pls check at ur side and then guide.

u know if u have uac enabled , and u try to open regedit with run it ask for permission, then how could vbs be allowed to change registry without permission. i think some code need to be added.
dear, i got alternative to solve this problem.

i do not require solution of this query. thanks for help.
thanks