cdemott33
asked on
Help creating batch file to open/close a website
Hi All -
I've been tasked to come up with a way to execute an asp webpage each morning at 9am. The page performs some calls to my Database and emails the results to a specific set of users.
I did some research online and found out that I need to create a "Batch" file and have a "Schedule Task" execute it daily.
I've never written a batch file so my question is this:
How does one create a batch file to
A. Open a browser to a specific website/page thus executing the ASP code that emails the results.
B. Close the browser once the page has completely loaded.
Thanks for your help!
I've been tasked to come up with a way to execute an asp webpage each morning at 9am. The page performs some calls to my Database and emails the results to a specific set of users.
I did some research online and found out that I need to create a "Batch" file and have a "Schedule Task" execute it daily.
I've never written a batch file so my question is this:
How does one create a batch file to
A. Open a browser to a specific website/page thus executing the ASP code that emails the results.
B. Close the browser once the page has completely loaded.
Thanks for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Gabriel.. that's a cool use of ping
ASKER
Gabriel -
This line here:
Could you explain to me what it's doing?
This line here:
ping 127.0.0.1 -n 8 -l 0
taskkill /f /im iexplore.exe /t
Could you explain to me what it's doing?
The first line there is executing a ping to act like a pause, the next one kills internet explorer
ASKER
Thanks Gabriel. I'll give this a try.
No problem.
It seems, however, that you need a little more functionality. I'd suggest a script like the kind you can create with AutoIT.
https://www.autoitscript.com/site/autoit/
I don't know that they have a way to detect if a page has 'fully loaded'. I guess technically, you could write a value to the user's cache file (assuming the webpage is internal and you designed it".. you could also tell the script to wait a specific amount of time and then close it.