Simple URL go to code

By Snorlax on May 02, 2012

Hello,

This is my first Snippet I've ever posted here, so if it's a waste - Sorry, just delete it :P

It maybe useful for some people, or to add on to. All it does is open a box where you can type in an address for example Google and from there it will change it to www.Google.com and open it up in your web browser as a new tab. All that is needed is the middle part of the URL.

Take the code and put it into a note pad, then save as anything.vbs

If you want to change the browser it uses please change where it says " "chrome.exe " " to the process of your browser and hit save.

Some Browser names:
Internet explorer = iexplore.exe
firefox = firefox.exe
chrome = chrome.exe

If you want to stop it from being infinite (on a loop) remove 'do' and 'loop' from the code and then save again. Because of the loop the 'Cancel' button is made void until the loop is removed.

set oSH = createobject("Wscript.Shell")
do
search = "www." & Trim(inputbox ("Type website name, Eg  Google:")) & ".com"
oSH.Run "chrome.exe " & search, 1, true ' to wait or false to not wait for completion
loop

Comments

Sign in to comment.
Hawkee   -  May 03, 2012

@sean Very good thinking.

 Respond  
sean   -  May 03, 2012

@Snorlax To add a bit more functionality, I would do some research and find how to target the users' default browser :)

PS: There's certainly no waste by posting your code. Keep posting!

 Respond  
Hawkee   -  May 03, 2012

@Snorlax There you go. Thank you.

 Respond  
Snorlax   -  May 03, 2012

Okay I changed that, sorry it's my first time posting :P

 Respond  
Hawkee   -  May 02, 2012

You shouldn't include the taskkill call within this snippet. Somebody might just take it all at once not knowing they've got that extra bit of code there.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.