Am writing my first script and want to be able to login to a website using my login and password. Have found lot's of useful items through here but can't get the login id and password to get entered. It appears that the focus is not being set on the website. It will open the webpage but keeps it minimized in the taskbar.
I am running vista and use the grouping function for similiar items.
I have noticed that if I save the script to the desktop and run it from there it will open on the screen but still no focus on the website.
If I open the website manually it will come up with the cursor already in the login name box.
Any ideas are greatly appreciated.
Here is the code:
Set objShell = CreateObject("WScript.Shell")
Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
objExplorer.Navigate "objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 1000
objExplorer.Height = 500
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
WScript.sleep 3000
objShell.SendKeys "login"
objShell.SendKeys "{tab}"
wscript.sleep 1000
objShell.SendKeys "password"
objShell.SendKeys "{enter}"
I am running vista and use the grouping function for similiar items.
I have noticed that if I save the script to the desktop and run it from there it will open on the screen but still no focus on the website.
If I open the website manually it will come up with the cursor already in the login name box.
Any ideas are greatly appreciated.
Here is the code:
Set objShell = CreateObject("WScript.Shell")
Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
objExplorer.Navigate "objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 1000
objExplorer.Height = 500
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
WScript.sleep 3000
objShell.SendKeys "login"
objShell.SendKeys "{tab}"
wscript.sleep 1000
objShell.SendKeys "password"
objShell.SendKeys "{enter}"