Scheduled task to launch a browser window with a URL if its not already running.

Posted on 2011-04-29
Last Modified: 2013-11-19
Hello Experts,

I have this requirement of a particular web page to be running all the time in Windows.
I can write a scheduled task with START "" "URL" to instantiate it.

How can I check if the browser with the URL is already running?
If not, onloy then call START "" "URL". This mechanism needs to be incorporated in my scheduled task.

Question by:fantasylan
    1 Comment
    LVL 7

    Accepted Solution

    Here's some code to check the "Shell.Application" object for instances of a particular ".locationURL", in this case Google.  If it does find it running, it simply alerts the user with a MsgBox and if it is not running, it launches Google using hte InternetExplorer.Application's Navigate method.

    Set objShell = CreateObject("Shell.Application")
    Set objIE = CreateObject("InternetExplorer.Application")
    strWebPageURL = ""
    For Each objWindow In objShell.Windows()
    	If objWindow.locationUrl = strWebPageURL Then 
    		WebPageIsRunning = True
    	End If
    If WebPageIsRunning Then
    	MsgBox strWebPageURL & " is already running"
    	objIE.Navigate strWebPageURL
    	objIE.Visible = 1
    End If

    Open in new window

    It may need some modification for your needs based on the exact URL of your particular webpage.  The strWebPageURL should be the EXACT address as shown in the IE address bar.  If the URL has some part of it that varies, that will also need to be taken care of with some extra code.  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    This script will sweep a range of IP addresses (class c only, and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
    Recently, an awarded photographer, Selina De Maeyer (, completed a photo shoot of a beautiful event ( in An…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now