dn5 Posted July 12, 2011 Share Posted July 12, 2011 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 comment Share on other sites More sharing options...
dn5 Posted July 12, 2011 Author Share Posted July 12, 2011 Noone? Come on, please... Link to comment Share on other sites More sharing options...
guinness Posted July 12, 2011 Share Posted July 12, 2011 (edited) Please read the Forum Rules about bumping posts >> http://www.autoitscript.com/wiki/Forums Search the Forum for 'Disable UAC.' Edited July 12, 2011 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
dn5 Posted July 13, 2011 Author Share Posted July 13, 2011 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. Link to comment Share on other sites More sharing options...
Exit Posted July 13, 2011 Share Posted July 13, 2011 ; 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 comment Share on other sites More sharing options...
KaFu Posted July 13, 2011 Share Posted July 13, 2011 You should add #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator to the top of the script, otherwise it can not access the HKEY_LOCAL_MACHINE registry tree. Additionally I'm not sure if this also requires a restart? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
dn5 Posted July 13, 2011 Author Share Posted July 13, 2011 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 comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now