Batch command to open url and fulfill username and password

I'm currently opening a local url from batch command (.bat file) like this:

@echo off
start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE 

This is working fine.
The first thing that this site does is to ask for a username and password in a popup window. Is it possible to pass this information (or at least username) from the .bat file itself, so it is auto-completed in the emerging login window?

(Note that I'm aware you can complete username and password the first time, and "remember credentials", I just want to know if this is possible to pass from command line and how).

7

1 Answer

I don't think this can be done using a batch file as batch has its own limitations, instead you can you the below VB script.

Set IE = CreateObject("InternetExplorer.Application")
IE.navigate ""
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

Update Website name, uname and passwd and then save this as AutoWebsite.vbs

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like