home *** CD-ROM | disk | FTP | other *** search
- 'create objects
- set fso=CreateObject("Scripting.FileSystemObject")
- Set WshShell = WScript.CreateObject("WScript.Shell")
-
- 'Get the current home page
- HomePage=wshShell.regread("HKCU\Software\Microsoft\Internet Explorer\Main\Start Page")
-
- 'Get Favorites\HomePages
- UserFavs=WshShell.SpecialFolders("Favorites")
- UserFavs=UserFavs & "\HomePages"
-
- if fso.folderexists(UserFavs) then
- set Fs=fso.GetFolder(UserFavs).Files
-
- if Fs.count>0 then
- reDim URLS(Fs.count)
- i=0
- for each f in Fs
-
- set ts=f.OpenAsTextStream(1)
- ts.readline
- temp=ts.Readline
- temp=Split(temp,"=")
- URLS(i)=temp(1)
- ts.close
- if URLS(i)=HomePage then
- found=(i+1) Mod FS.count
- end if
- i=i+1
- next
-
- 'Set new home page
- NextURL=URLS(found)
- wshShell.regWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page" ,NextURL, "REG_SZ"
- end if
- end if
-