Faraz Posted January 2, 2018 Share 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() Link to comment Share on other sites More sharing options...
water Posted January 2, 2018 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Faraz Posted January 2, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
Faraz Posted January 2, 2018 Author Share Posted January 2, 2018 Link to comment Share on other sites More sharing options...
Developers Jos Posted January 2, 2018 Developers Share 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. 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