Created
December 19, 2014 07:38
-
-
Save bangonkali/569ff53c8a2b8119df2d to your computer and use it in GitHub Desktop.
Waits for Windows Security to open and fills up with password and username.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Debug.au3> | |
WaitForWindowsSecurity() | |
Func WaitForWindowsSecurity() | |
Local $Interval = 20 | |
Local $Interval_Loop = 200 | |
_DebugSetup("Waiting for Windows Security") | |
_DebugOut("Initiating wait script for Windows Security.") | |
While True | |
_DebugOut("Waiting for Windows Security.") | |
; Wait 10 seconds for the Notepad window to appear. | |
WinWait("Windows Security") | |
; Retrieve the handle of the Notepad window using the classname of Notepad. | |
Local $hWnd = WinGetHandle("Windows Security") | |
If @error Then | |
Sleep($Interval_Loop) | |
_DebugOut("Did not find windows security.") | |
ExitLoop | |
Else | |
_DebugOut("Found windows security.") | |
Sleep($Interval) | |
WinSetOnTop($hWnd,"OK", 1) | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:1]", "^A") | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:1]", "{DEL}") | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:1]", "domain\") | |
Send("^{TAB}") | |
Sleep($Interval) | |
Send("^+{TAB}") | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:1]", "username") | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:1]", "^A") | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:1]", "{DEL}") | |
Sleep($Interval) | |
ControlSend($hWnd,"","[CLASS:Edit; INSTANCE:2]", "password") | |
Sleep($Interval) | |
ControlClick($hWnd,"OK","[CLASS:Button; INSTANCE:2]") | |
EndIf | |
WEnd | |
EndFunc ;==>Example1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment