Jump to content

Recommended Posts

Posted

Hello guys, I start to code UAC disabler but I stop in no-time. I did something similar in Delphi but I want to try it in AutoIt. The concept is like this: OpenWindow(UAC)->WaitForWindow->Press down-key button 5 times (one to lost focus from help link (check: http://res1.windows.microsoft.com/resbox/en/Windows%207/main/1/1/11accf4f-c212-4a00-887d-d247b58f97e2/11accf4f-c212-4a00-887d-d247b58f97e2.jpg), and other 4 times to move slider to minimum. This works fine when I do it with keyboard but when I try to code it, It just don't work. So probably 'Send' is a problem, or maybe UAC it self? When I try same thing with notepad it works fine when I use for example {ENTER}, but when I use {ENTER} in UAC it resist to do so; to press Enter. Same thing with click button, I resist to get focus. Here is the function:

;//-------------------------------------------------------------------------------------------------------------
;// Global variables and constants

dim $vPath          ;   Path filename (*.exe)
dim $counter        ;   How many times did I press down arrow
dim $handle         ;   Process handle
dim $active         ;   Is widnow (UAC) active

const $title    =   'User Account Control Settings' ;   Title of window

;//-------------------------------------------------------------------------------------------------------------
;// Variable initializing | Full path is: X:\WinDir\Sys32Dir\*.exe

$vPath = 'UserAccountControlSettings.exe';

;//-------------------------------------------------------------------------------------------------------------
;// Functions

func DisableUAC()
    $wCounter = 0;
    $handle = run($vPath);
    if $handle <> 0 Then
        $active = WinActive($title);
            if $active > 0 Then
                for $wCounter = 0 to 5
                    SendKeepActive($title);
                    Send("{DOWN}");
                next
                ;Command->Click
            endif
    elseif $handle = 0 Then
        DisableUAC();
    endif
endFunc

DisableUAC();

I don't think thats because of UAC security, because I did similar, not same, but similar method with Delphi (SendMessage to slider class and set value to 0).

Any help would be appriciated,

Cheers.

Posted (edited)

Please read the Forum Rules about bumping posts >> http://www.autoitscript.com/wiki/Forums

Search the Forum for 'Disable UAC.'

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

guinness, I must admit that was my mistake about bump, but I already look over the forum and didn't find any UAC disabler similar or same to my method (Window/Controls).

Regards.

Posted

; Disabble Local User Access (LUA)
$OldState = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA")
$text = @LF
$msgicon = 64
If $OldState Then
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA", "REG_DWORD", 0)
    If @error Then
        $text &= "Fehler beim Ausschalten des Local User Access (LUA)    Fehlercode: " & @error & @LF & @LF
        $msgicon = 48
    Else
        $text &= "Der Local User Access (LUA) wurde ausgeschaltet."
    EndIf
Else
    $text &= "Der Local User Access (LUA) war bereits ausgeschaltet."
EndIf
$NewState = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA")
$text &= @LF & @LF & @LF & "Status:     alt/neu    " & $OldState & "/" & $NewState

MsgBox(4096 + 262144 + $msgicon, "DisableLUA", $text)

OK, that's a german solution. But should run in every language.

If translation needed, just ask for it.

Regards forumer

App: Au3toCmd              UDF: _SingleScript()                             

Posted

Thanks for both last replys. Again, I said I found writting to registry method, but I want to do it without accessing the registry. Usually, when you open UAC without administrator right you are able to set none security level, and when you press OK, you will see popup that you really want to do that, and if you press Yes there will be none security level because UAC is off. Read my thread on how my method should work on this principe.

Greetz,

dn5.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...