Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to login website with username and password using windows (XP) batch script [closed]

I am able to connect website using batch file but I don't know how to insert username & password into it and of course a click on submit button.

Also i would like to know how to click buttons available on sites (ex. export in xls option) using windows batch script.

Thanks in advance.

like image 668
ravindra.ashok Avatar asked Mar 25 '23 04:03

ravindra.ashok


1 Answers

With batch I can't think of a way. With VBScript, it's easy. Create a new text file and name it AutomateIE.vbs and add the following code. Double click it to run it.

Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://TheWebsite"
IE.Visible = True

While IE.Busy
    WScript.Sleep 50
Wend

Set ipf = IE.document.all.username
ipf.Value = "Username" 
Set ipf = IE.document.all.password
ipf.Value = "Password" 
Set ipf = IE.document.all.Submit
ipf.Click 
IE.Quit

Make sure username and password are the actual names defined in the website or it won't work. Change them to whatever they should be. If you post the URL, I can verify them.

like image 179
Matt Williamson Avatar answered Apr 05 '23 23:04

Matt Williamson