Computing.Net > Forums > Programming > VBScript to launch a secure website login

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBScript to launch a secure website login

Reply to Message Icon

Name: Nilesh.David
Date: October 31, 2009 at 06:18:31 Pacific
OS: Windows XP
CPU/Ram: 512MB
Subcategory: Batch
Comment:

Hi all,

I almost got what I was looking for but this time its related to a secure website. I wish to launch a secure site and log onto it using the username and password supplied in the vbscript file. Razor had posted the below code for a normal website login. It's a great code but I don't know where am I going wrong for a secure site... Do I need to add any other string/code?

WScript.Quit Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://www.gmail.com"
  Wait IE
  With IE.Document
    .getElementByID("Email").value = "nilesh.david"
    .getElementByID("Passwd").value = ""
    .getElementByID("gaia_loginform").submit
  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

Thanks for any help...



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: October 31, 2009 at 21:18:14 Pacific
Reply:

From Nilesh.David 05:55:17 10/31/2009 (reply).
Hi Razor, I read your post about using VBScript to start a website and logonto it using the usernames and passwords provided. But, I need a script that will be used for a secure website. I tried your method but it gives me a "getElement" error...
Any help would be much appreciated.
----------------------------------------------------

Your example is working for me, I don't know why you can't access the DOM. The only thing I could suggest would be to add a

WScript.Sleep 5000

before the first .getElementByID().

Alternatively, you could try changing the address to "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false"


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: VBScript to launch a secure website login

Logon VBScript to Launch EXE www.computing.net/answers/programming/logon-vbscript-to-launch-exe/19295.html

Secure website www.computing.net/answers/programming/secure-website/4402.html

VBscript to change homepage www.computing.net/answers/programming/vbscript-to-change-homepage/11766.html