Hi Group,

OS Windows 7 64bit
User login on, is local admin
for an installation, which should be started by means of the login script, the UAC Settings should be disabled.

To achive this, it should be possible to deactivate uac through changing a registry key.

The user, beeing local admin, can change the registry manualy.

I use following code:

$Key=("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System")
$Val=("EnableLUA")
$Type=("REG_DWORD")
$Entry = ReadValue($Key,$Val)
? $Entry
IF $Entry = 1
$NewEntry= 0
WriteValue($Key, "$Val", $NewEntry, $Type)
? ''+@ERROR+' - '+@SERROR
if @error = 0
? "Value written"
else
? "Value not written!"
endif


--------------

? ''+@ERROR+' - '+@SERROR gives message "5 - acces denied"

It doesn't matter wether to UAC is only disabled after reboot. Users log on often and I can check the settings everytime the users log in. After installation I want to switch UAC on again

Help is very welcome!

Best Regards Georg



Edited by KidLark (2013-05-02 01:25 PM)