Jump to content

Recommended Posts

Posted

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

image001(7).png

Posted

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

 

Posted

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
Posted

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

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