Faraz Posted January 2, 2018 Posted January 2, 2018 I am trying to insert the credentials in an application which accepts the URL in IE URL bar against which it Opens a Windows Security popup in which credentials are filled , WHich i m unable to achieve via my Code , which worked twice but now it is not functioning as meant to be. Review the Code and the Snapshot attached #include <Constants.au3> #include <IE.au3> If $CmdLine[0] <> 3 Then MsgBox($MB_OK, "Usage", "ps_ASDM <url> <username> <password>") Else asdm_login($CmdLine[1], $CmdLine[2], $CmdLine[3]) EndIf Func asdm_login($url, $username, $password) Local $ie = _IECreate($url) sleep(1000) If VarGetType($ie) == "Object" Then $hwnd = _IEPropertyGet($ie, "hwnd") WinSetState($hwnd, "", @SW_MAXIMIZE) WinWaitActive("Windows Security") $hwnd = WinGetHandle("Windows Security") ;sleep (1000) ;send("{Tab}") ;Send($ip) ;Send("{Tab}") ControlSend($hWnd, "", "", $username) Send("{Tab}") ControlSend($hWnd, "", "", $password, 1) Send("{Tab}") Send("{Tab}") ;Send("{Tab}") Send("{Enter}") EndIf EndFunc ;==>winscp_login()
water Posted January 2, 2018 Posted January 2, 2018 Welcome to Autoit and the forum! Storing credentials in a script isn't a very good idea - from a security point of view. I suggest KeePass as store for your credentials plus the KeeForm plugin to open websites and fill in the login data automatically. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Faraz Posted January 2, 2018 Author Posted January 2, 2018 Actually i am not storing the credentials we are using cmd to pass URL , Username and password via this script, i m testing it via cmd u can see in second snapshot
Developers Jos Posted January 2, 2018 Developers Posted January 2, 2018 Funny: You "tried" to make the private 172.x.x.x unreadable but failed dramatically! It is still pretty much readable, but having said that, it is an private ip address so there can't be too much harm in there. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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