howto://launch a webpage from a batch file

So there is a class I am trying to get into, and apparently it’s so full that the waitlist is massive. They sent an email blast out for the first open seat on a “first to respond wins” basis. I wasn’t first. If they happen to send another email blast though, I will win that time, because this is what I am doing.

  1. Create a rule in Outlook to launch an app when the next email arrives. I used the “Subject contains” rule since it is definitely unique.
  2. Create a register.cmd file that contains the following
    START "" "c:\scratch\reg.html"
  3. Create “c:\scratch\reg.html” to include the following
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    < html>       
       <meta http-equiv="Refresh" content="0; url=http://theurloftheregistrationlink" />       
    < /html>
  4. Make sure I leave Outlook open since this is a client-side rule.

If you use the START command in a batch file, you can specify the title of the window that is open. Since I am trying to invoke my browser, I need to specify a blank title else it will just create a cmd prompt with that URL as the title.

If the URL was a little more straightforward, I could invoke it directly from the START, but in this case the URL has some interesting bits that just make it easier to keep in a separate page.

If all goes well, victory will be mine! And if not, I still learned something cool today, hence the share. Hope this helps someone else (just not anyone going for the same class as me!)

Leave a Reply

Your email address will not be published. Required fields are marked *