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!
cdemott33Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gabriel CliftonNet AdminCommented:
I have actually just done this. This batch file opens youtube and closes after set amount of time ( roughly 8 seconds) by use of pinging self.
@echo off
cls
echo.
echo http://www.youtube.com
start cmd /c "C:\Program Files\Internet Explorer\iexplore.exe" http://www.youtube.com

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

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MontoyaProcess Improvement MgrCommented:
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.
0
MontoyaProcess Improvement MgrCommented:
Gabriel.. that's a cool use of ping
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

cdemott33Author Commented:
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?
0
Gabriel CliftonNet AdminCommented:
The first line there is executing a ping to act like a pause, the next one kills internet explorer
0
cdemott33Author Commented:
Thanks Gabriel.  I'll give this a try.
0
Gabriel CliftonNet AdminCommented:
No problem.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.