1.

Solve : Log into website??

Answer»

Hello fellow nerds

I just had a request to create an "ICON" on a DESKTOP for multiple PCs that multiple users will need to access. It will be a shortcut to a website. I have no problems creating an EXE that is a shortcut to a site. The problem is the user wants me to create a script that will automatically log into the website when it opens...I am totally lost with this. I believe you can not create a BAT file that passes credentials, but you can create a VBS that will. Can anyone assist me in fulfilling this request?

Thank you!

HoFLSorry to double post. This is more of an update / FYI type post.

I FOUND a script that works perfectly! Check it out. All you need to do is view the source code of the page you are trying to log into, then get the string name for the user name, PASSWORD and login button. You will also need the "value" of the button. Let me know if you guys need any help!

Code: [Select]WScript.Quit Main

Function Main
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
IE.Navigate "http://www.chiltonpro.com/home.aspx"
Wait IE
With IE.Document
.getElementByID("Mkt_lnav1_mkt_login1_txtUsername").value = "ITS A SECRET"
.getElementByID("Mkt_lnav1$mkt_login1$txtPassword").value = "ITS A SECRET"
.getElementByID("Mkt_lnav1$mkt_login1$btnLogin").click
End With
End Function

Sub Wait(IE)
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
End Sub

Sub IE_OnQuit
On Error Resume Next
WScript.StdErr.WriteLine "IE closed before script finished."
WScript.Quit
End Sub



Discussion

No Comment Found