All source code in ASP/ VbScript Ask a ASP/ VbScript Pro Discussion Forum Categories All jobs in ASP/ VbScript
Quick Search for:  in language:    
Using,Windows,Scripting,Host,VBScript,retriev
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 281,252. lines
 Jobs: 101. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login

NEW! LEARNING CENTER
Special educational offers, white papers, webcasts, podcasts

  NEW! Download Rational Performance Tester V8 (download now)
  NEW! Download Rational Functional Tester V8 (download now)
  NEW! Download Rational Service Tester for SOA Quality V8 (download now)
  NEW! Teleconference: Quality In Action - Using Rational Quality Manager with Functional, Performance and Web Service Testing Products (download now)
  NEW! Introducing IBM Rational AppScan Developer Edition – easing security testing by non-security professionals (download now)

 

 


Latest postings for ASP/ VbScript.
Web Online Examination
By Suhas Manjunath Kashyap on 11/7


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

Browse Favorites

Print
Email
 
VB icon
Submitted on: 3/17/2000
By: Troy Demet 
Level: Beginner
User Rating: By 14 Users
Compatibility:VbScript (browser/client side)

Users have accessed this code 32102 times.
 
 
     Using the Windows Scripting Host this VBScript retrieves the users favorites folder and loads the url links into an array, then goes to each site for three minutes.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    '**************************************
    ' Name: Browse Favorites
    ' Description:Using the Windows Scriptin
    '     g Host this VBScript retrieves the users
    '     favorites folder and loads the url links
    '     into an array, then goes to each site fo
    '     r three minutes.
    ' By: Troy Demet
    '
    ' Inputs:User can input how many sites t
    '     hey wish to browse.
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/vb/scripts/Sho
    '     wCode.asp?txtCodeId=6104&lngWId=4    'for details.    '**************************************
    
    '=======================================
    '     ===================================
    '
    ' VBScript Source File -- 
    '
    ' NAME: favoritesURL.vbs
    '
    ' AUTHOR: Troy Allen Demet , TechnoGeek,
    '     Inc.
    ' DATE : 2/25/00
    '
    ' COMMENT: This script will put the url 
    '     of your favorites into an array
    '			and then browse to each web site at 
    '     3 minute intervals.
    '
    '=======================================
    '     ===================================
    Option Explicit
    	Dim objShell, objWshShell, fso,fld, objFiles
    	Dim urlUpper, urlLower, Folder, j, ie, arURL(), fileCount, howMany
    	'Dim objFolder, file, count, fileType, holder
    	
    	Set objShell = WScript.CreateObject("Shell.Application")
    	Set objWshShell = CreateObject("WScript.Shell")
    	Set fso = CreateObject("Scripting.FileSystemObject")
    			
    	Folder = objWshShell.SpecialFolders	("Favorites")
    	Set fld = fso.GetFolder(Folder)
    	Set objFiles = fld.Files
    	fileCount = objFiles.Count
    	ReDim arURL(fileCount)
    	
    	howMany = InputBox("Please enter how many sites you wish To browse.","How Many?",10)
    	
    	if howMany < 1 Then
    		WScript.Quit	
    	End if
    	
    	getFile(Folder)
    	
    	urlUpper = UBound(arURL)				' Upper bound of arURL
    	urlLower = LBound(arURL)				' Lower bound of arURL	
    	
    	if urlUpper < 1 Then
    		MsgBox "Sorry nothing To show",,"Nothing to Show"
    		WScript.Quit	
    	End if
    	if howMany > urlUpper Then
    		howMany = urlUpper - 1
    	End if
    	
    	' Create the ie object (Internet Explorer)
    	Set ie = CreateObject("InternetExplorer.Application")
    	
    	' Set the properties of Internet Explorer		
    	With ie
    		.left 		= 100
    		.top 		= 100
    		.height		= 460
    		.width		= 620
    		.menubar	= 0						' False
    		.toolbar	= 0						' False
    		.visible	= 1						' True
    	End With
    	
    	
    	
    	' Loop through the array		
    	For j = urlLower To howMany
    		
    		if arURL(j) <> "" Then
    			
    			goUrl(arURL(j))
    		End if
    	Next
    	MsgBox "Quitting getFiles script"
    	
    	' Clean up after yourself
    	ie.Quit
    	Set ie = Nothing
    	WScript.Quit	
    			
    function readFile(filePath)
    	On Error Resume Next
    	Dim fileObject
    	Dim link, shellObject, line
    		
    	Set fileObject = CreateObject("Scripting.FileSystemObject")
    	Set shellObject = CreateObject("Wscript.Shell")
    	Set link = shellObject.CreateShortcut(filePath)
    	
    	' Use the MsgBox For debugging
    	 'MsgBox "temp" & vbCrLf & Link & vbCrLf & link.TargetPath
    	' Return the value
    	readFile = link.TargetPath	
    	
    End function
    function goURL(aURL)
    	' go To the web site
    	ie.navigate(aURL)
    	
    	'Wait 3 minutes
    	WSCript.Sleep(180000)
    End function
    Sub getFile (dir)
    	Dim objFolder, objSubFolder, objFiles, objSubFiles, Folder, subFolder, File, subFileCount, count
    	Dim fileType
    	
    	Set objFolder = fso.GetFolder(dir)
    	Set objSubFolder = objFolder.SubFolders	
    	Set objFiles = objFolder.Files
    		
    	For Each Folder In objSubFolder
    		Set subFolder = fso.GetFolder(Folder)
    		Set objSubFiles = subFolder.Files
    			
    		subFileCount = objSubFiles.Count
    		fileCount = fileCount + subFileCount
    		
    		ReDim Preserve arURL(fileCount)
    		
    		getFile(Folder)
    	Next
    	
    	File = 0
    	count = 0
    	For Each File In objFiles
    		fileType = File.Type
    		
    		' Want only *.url files
    		if fileType = "Internet Shortcut" Then
    			'MsgBox "fullPath" & vbCrLf & File.Path
    			arURL(count) = readFile(File.Path)
    		End if
    		count = count + 1
    		
    	Next	
    	
    End Sub


Other 1 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/18/2003 7:10:13 PM

I could not get this code to work, It did not like the WScript, Do you need anything speical on the server for this code to work?

Thank you,
Tony Macholtz
(If this comment was disrespectful, please report it.)

 
1/27/2005 11:42:02 AM

I have the same problem. WScript is undefined. Is it a com object that needs to be installed on the server?
(If this comment was disrespectful, please report it.)

 
1/27/2005 11:58:01 AMTroy Demet

You will need to have Windows Script Host installed on your machine.
(If this comment was disrespectful, please report it.)

 
2/25/2005 5:30:54 AM

I am trying to make an asp page
(If this comment was disrespectful, please report it.)

 
2/25/2005 5:32:17 AM

Ho can I use this script to make an asp page?
(If this comment was disrespectful, please report it.)

 
10/7/2007 9:45:30 PMMatt DeKok

LOL!!! You could make a sweet search engine/directory with something like this. Simply make it store the sites in a database and pull them up in order by the most commonly bookmarked.
(If this comment was disrespectful, please report it.)

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2008 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.