Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduled task to open URL

At a certain time each day, I'd like my browser to pop open a tab to a certain URL.

My goals:

  1. be able to set the URL from the scheduled task
  2. use the default browser (rather than hard-coding it)

I can't seem to accomplish both of these goals at once. I'll post my partial solutions as answers, but I'm hoping someone will have something better.

like image 836
Jeremy Stein Avatar asked Dec 23 '22 03:12

Jeremy Stein


1 Answers

Note that this command will open the default browser (or a new tab therein) to the given url:

cmd /c start http://example.com

To create a scheduled task without the command window popping up:

Create OpenUrl.vbs:

CreateObject("Wscript.Shell").Run "cmd /c start " & Wscript.Arguments.Item(0), 0, False

Then call it from a scheduled task with this command:

wscript.exe "C:\Path\To\Script\OpenUrl.vbs" http://example.com
like image 142
dmb Avatar answered Jan 14 '23 05:01

dmb