Yep. The code I posted should be able to handle a dialog box. The magic there is:
Code:
sleepMax = 0
Do While WshShell.AppActivate("Enter Network Password") = FALSE
WScript.Sleep 200
sleepMax = sleepMax + 200
If sleepMax > 20000 Then Exit Do
Loop
Basically the WshShell.AppActivate button returns a boolean indicating whether it could activate (bring to top even if minimized) a window with the given title. The title doesn't have to match exactly, it just tries to find the first match. So if your password box title showed something like "Please Enter Password Visitor #1234567" then you could feed "Please Enter Password" to AppActivate and it would match since the beginning of the popup title matches.
The sleep loop is there to give IE time to load the page and show the popup. Basically the loop tries to activate the login box. If it fails then it goes to sleep for 200 milliseconds, then tries again. The counter slowly increments to 20 seconds (20000ms) each time. If the counter reaches 20 seconds it escapes the loop and bypasses some later portions of the code to exit gracefully. The reasoning behind this is that you don't want this thing sitting in the background indefinately until a week later it sees a login box and tries to do it's magic on it. Additionally if you are executing on a schedule you could conceivably have tons of these still sleeping in the background, adding unnecessary load to the systemand causing all kins of havoc if several of them try to wakeup at the same time.
The best resource is Google

If you search on the following lines, one at a time, you will learn more than you ever wantedto know about each one:
WScript.Shell
Shell.AppActivate -
heres a good google cache of an MS link
WScript.CreateObject("InternetExplorer.application","IE_")
Those are probably the three core pieces of the script, withthe SendKeys method being referenced in that google link.
The only piece missing from this equation is some fiddling with Scheduled Tasks. To run this as a scheduled task you will want to setup a scheduled task to run WScript.exe (System32 folder I think) with the path to the script as an argument. If you need to pass additional arguments to your script you can add them in also and access those values from your script via WScript.arguments
If you need this to run more often then Scheduled Tasks gives you options for, then there is some trickery involved.
This is delving into anothe topic, but here goes.
Setup your scheduled task as if you wanted it to run Daily (shoudl be a radio option). Then edit your task and go to the tab that lets you define your schedule. Hit the advanced button and set your start time to 12AM, your end time to 11:59PM, and the
run task every... to run every 5 minutes. Save it, execute your task. It will now run each day at midnight. Each time it runs it will set it's next run time to 5 minutes later, and it will not set a run time later than 11:59PM. Of course at 12:00am the process starts again.
Another example would be to make it run every 15 minutes during business hours, which would be a start time of 8AM, an end time of 5PM and a 'run every' of 15 minutes.
Hope this proves useful,
-T