Jump to content

Recommended Posts

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.

Link to post
Share on other sites

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:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to post
Share on other sites

; 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()                             

Link to post
Share on other sites
Link to post
Share on other sites

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.

Link to post
Share on other sites

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...