PDA

View Full Version : Login Script


steverz
09-21-2005, 01:42 PM
Im trying to write a login script that will launch a page and send the login information without me typing it. I dont know if this would work because i need to send the text to a form....
So far I have:

strMonth = Month(Date)
strDay = Day(Date)
If Len(strDay) = 1 Then strDay = "0" & strDay
strYear = Right(Year(Date), 2)
curDate = strMonth & "/" & strDay & "/" & strYear

set WshShell = CreateObject("WScript.Shell")
WScript.Sleep(100)

WshShell.Run "http://loginsite.com/index.html"
WScript.Sleep(100)

WshShell.SendKeys "username" & "{TAB}" & "{ENTER}"

This does not send the text at all, any ideas or help or lead me in the right direction?

TrojanWarBlade
09-21-2005, 01:49 PM
Why bother with all that hassle when you can just cut and paste the login page, drop in the values and add a one line of javascript to send the values?
e.g.

<head>
<script>
function send(){
document.forms['Form'].submit();
}
</script>
</head>
<body onload="send();">
</body>

And just put your form and it's data straight in there.