0 Replies - 1102 Views - Last Post: 04 May 2011 - 01:44 PM

#1 Creecher  Icon User is offline

  • I don't care
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,049
  • Joined: 06-March 10

Batch Launcher

Posted 04 May 2011 - 01:44 PM

Description: Read the comments.Launch your websites through CMD.
:: First we get rid of the ugly C:/Windows crap
@echo off
:: Set the color to a nice phosphourus green. #00FF00 for you people that love this color, I know I do (it's the main color scheme on my website :D )
color 0a
:: Set the title of the file, get rid of the CMD.exe stuff
title Website Launcher
:: Call the loop that will be used later.
:loop
:: Display what we want in our launcher.
echo Website Launcher
::Display a linebreak so we have some spacing.
echo.
echo 1. www.dreamincode.net
echo 2. www.google.com
echo 3. www.last.fm
echo 4. www.freewebarcade.com
echo 5. www.neverpool.com
echo 6. Exit
echo.
:: Another loop, if you hit a wrong option, it reloops itself.
:first
echo Enter your option :
:: Insert your command
set /p opt=
:: Pretty simple. If 1 was inserted into the command prompt, then it goes to the one variable. 
if %opt%==1 goto one
:: Call more variables.
if %opt%==2 goto two
if %opt%==3 goto three
if %opt%==4 goto four
if %opt%==5 goto five
if %opt%==6 goto six
:: in order to add a new option, call it like so: [if %opt%==7 goto seven] then call the variable information below, just like the others. 
:: Anything other than a valid option will echo this.
echo Invalid Option
goto first
:: :one calls the 'one' variable
:one
:: This will open your URL in your default web browser.
explorer http:\www.dreamincode.net
:: Clear the screen to reduce clutter
cls
:: After the screen clears, go back to the loop declared as :loop and re-echo your URL list. 
goto loop
:two
explorer http:\www.google.com
cls
goto loop
:three
explorer http:\www.last.fm
cls
goto loop
:four
explorer http:\www.freewebarcade.com
cls
goto loop
:five
explorer http:\www.neverpool.com
cls
goto loop
:six
:: Closes the CMD and stops running your .bat file. 
exit



Is This A Good Question/Topic? 0
  • +

Page 1 of 1