Link to home
Start Free TrialLog in
Avatar of cdemott33
cdemott33Flag for United States of America

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!
ASKER CERTIFIED SOLUTION
Avatar of Gabriel Clifton
Gabriel Clifton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Montoya
Montoya

a batch file is basically a text file with some commands.. pretty simple.
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.
Gabriel.. that's a cool use of ping
Avatar of cdemott33

ASKER

Gabriel -

This line here:

ping 127.0.0.1 -n 8 -l 0
taskkill /f /im iexplore.exe /t

Open in new window


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
Thanks Gabriel.  I'll give this a try.
No problem.