Solved VB script to login gmail in multiple firefox profile

September 12, 2014 at 04:28:57
Specs: Windows XP
Hi,

I have a question i have used above code to automate gmail login but it is not working.

Here is my code.

set WshShell = WScript.CreateObject("WScript.Shell")
sub shell(cmd)
dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(cmd)
Set objShell = Nothing
end sub

shell """C:\Program Files\Mozilla Firefox\firefox.exe"" --no-remote -p 11 https://gmail.com/"

WScript.Sleep 4000
WshShell.SendKeys "username"
WScript.Sleep 2000
WshShell.SendKeys "{TAB}"
WScript.Sleep 2000
WshShell.SendKeys "password"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
WScript.Quit()


See More: VB script to login gmail in multiple firefox profile

Report •

#1
September 12, 2014 at 06:56:51
✔ Best Answer
I am not very good with vbscript but it looked like you were not opening the site to the login page, i have modified it and it seems to work, i dont have a gmail account so cannot verify if it actually logs in, however the username and password fields are filled in.

Oh i had to replace firefox with internet Explorer - you can change this back if you need.

set WshShell = WScript.CreateObject("WScript.Shell")
sub shell(cmd)
 dim objShell
 Set objShell = WScript.CreateObject( "WScript.Shell" )
 objShell.Run(cmd)
 Set objShell = Nothing
 end sub

 shell """C:\Program Files\Internet Explorer\iexplore.exe"" <a href="https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail//" target="_blank" rel="nofollow">https://accounts.google.com/Service...</a>

WScript.Sleep 4000
WshShell.SendKeys "username"
WScript.Sleep 2000
WshShell.SendKeys "{TAB}"
WScript.Sleep 2000
WshShell.SendKeys "password"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
WScript.Quit()

message edited by AlwaysWillingToLearn


Report •
Related Solutions


Ask Question