35

I'm looking for a mechanism to open a single URL in the user's current default browser on a schedule/recurring basis.

I know that if I was writing .Net code to do this, I could simply do something along the lines of Process.Start("http://example.com/somePage.html") which will cause the default browser to open to that address. Likewise, I can go to Start -> Run and type in a given address and that too will cause the default browser to open to that address. Using this knowledge, I thought I would create a Windows Scheduled Task where the "Start a program" field was set to the URL I wanted to start. Unfortunately, this doesn't work. When the task runs, the URL is not opened (nor are any browsers).

Can anyone point me in the right direction to make this happen? Ideally, I would like to stay away from 3rd-party utilities, leveraging Windows' Task Scheduler would be great. Also, just to be clear, I'm not looking for a browser plugin to accomplish this.

Also, I'm not looking for anything fancy wrt waking a sleeping computer to carry this task out. I'm fine with just letting this happen only when a user is logged in.

36

I would create a batch file containing:

start http://example.com/somePage.html

And point Task Scheduler to that batch file. You can also test that it will work by running the batch file manually.

  • 3
    It may also work if you use that string as the command for your task, but I prefer to edit a batch file than have to look through my tasks if I need something changed. – Windos Aug 10 '11 at 4:38
  • Thanks @Windos, worked a treat. I found that it didn't work when that string was the command itself for my task. Could be that I was doing it wrong (missing "" around URL or something), but I didn't spent any extra time on it as the batch file solution gave me what I needed. – ckittel Aug 10 '11 at 13:51
  • The batch file approach works, but a black dos windows will flash. Is there any way to hide it? Using that string as the command of Task Scheduler doesn't work for me. – Gqqnbig Jul 6 '13 at 13:12
  • 1
    You will struggle with getting the batch file to actually get launched by Task Scheduler until you read this stackoverflow.com/questions/4437701/… – Matthew Lock Sep 3 '16 at 9:44
  • just note that it will open a tab in your default browser, and after a while if you do not close them automatically or manually will degrade the performance of the system – Iman Abidi Nov 28 '16 at 13:59
10

I've recently found myself trying to solve this exact issue and I have found a few things that can hopefully be of help.

Set up the scheduled task to run the following command:

explorer "http://example.com/somePage.html"

This does the trick without creating an extra file and without a flickering window. I have confirmed that this works on Windows 7 and opens the URL using the default browser.

The same trick however does NOT work in Windows XP. The same command in Windows XP will always use Internet Explorer to open the given URL. The best solution I have found for WIndows XP to date is to set up a scheduled task with

cmd /c start http://example.com/somePage.html

Again, no extra file required, but you do get a brief appearance of a command window.

I have not tested this on Windows Vista or Windows 8

  • It works on Windows Server 2012. cmd as the executable, and the rest for arguments. – Todd Sep 10 '16 at 12:12
  • See my expansion on this answer with pictures here - stackoverflow.com/a/39426110/887092 – Todd Sep 10 '16 at 12:35
3

You could make the Windows task manager run a program, and have it point to an HTML file that contains a redirection to the website you want it to open.

  1. Open Notepad.
  2. Write Javascript redirect.
  3. Save as HTML.
  4. Set task manager to open that HTML file on your desired schedule.

Here is the Javascript. Let me know if it works.

<script type="text/javascript">
window.location = "http://www.google.com/"
</script>
  • I have tested it, it works. – Alex Waters Aug 10 '11 at 4:50
  • 1
    +1. Thanks for this solution, I've tested it too, and it indeed works. @Windos solution is ideal for my needs, but I'm glad you posted this solution as it might be ideal for someone else. – ckittel Aug 10 '11 at 13:52
  • 1
    You mean "Task Scheduler->another program->my html->desired url"? Why don't the program directly open the desired url? – Gqqnbig Jul 6 '13 at 13:02
1

For some reason the above solutions weren't working for me on Windows Server 2008 so I ended up going with the vbs approach:

This has the added benefit of being able to do a POST with data if required.

Create a vbs file with the following contents:

Call LogEntry()

Sub LogEntry()

'Force the script to finish on an error.
On Error Resume Next

'Declare variables
Dim objRequest
Dim URL

'The URL link.
URL = "https://www.example.com"

Set objRequest = CreateObject("Microsoft.XMLHTTP")

'Open the HTTP request and pass the URL to the objRequest object
objRequest.open "GET", URL , false

'Send the HTML Request
objRequest.Send

'Set the object to nothing
Set objRequest = Nothing

End Sub

Credit to this site

0

There are programs like One Million Clicks that can refresh a web page every x seconds/min/hours. You can even use a list of proxies to simulate real visitors on that page.

0

If the reason that you're opening the webpage is that you need to keep an IIS application pool or worker process alive you can use a tool called Application Pool Defibrillator.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.