Quick question: what would the code look like to grab the entire
contents of Internet Explorer's history? Thanks!

Re: Getting the entire Internet Explorer history by Brian

Brian
Thu May 20 15:58:42 CDT 2004

Leslie,

window.history.length will tell you how many items are in it.

For security reasons, the history object does not expose the actual URLs in the
browser history. It does allow navigation through the browser history by
exposing the back, forward, and go methods.

Brian


Re: Getting the entire Internet Explorer history by lhouk

lhouk
Fri May 21 09:49:12 CDT 2004

Brian Staff <brianstaff@[NoSpam]compuserve.com> wrote in message news:<VA.00000273.2ed5e63f@bstaffw2k>...
> Leslie,
>
> window.history.length will tell you how many items are in it.
>
> For security reasons, the history object does not expose the actual URLs in the
> browser history. It does allow navigation through the browser history by
> exposing the back, forward, and go methods.
>
> Brian

Hmm. So there's no easy way to write a VBScript program that would dump
the contents of my 12-year-old son's IE history and mail it to me, so I
can make sure he isn't learning more about sex than I know?

Leslie

Re: Getting the entire Internet Explorer history by McKirahan

McKirahan
Fri May 21 10:54:00 CDT 2004

"Leslie Houk" <lhouk@ghg.net> wrote in message
news:e4ed9e5e.0405201112.620092e5@posting.google.com...
> Quick question: what would the code look like to grab the entire
> contents of Internet Explorer's history? Thanks!

What, more specifically, are you trying to do?

The first step is to identify the cache's path, if it isn't known, which can
be done by accessing the registry.

Given the path, use FSO to walk the folders for the filenames.



Re: Getting the entire Internet Explorer history by Brian

Brian
Fri May 21 13:58:15 CDT 2004

Leslie,

> Hmm. So there's no easy way to write a VBScript program that would dump
> the contents of my 12-year-old son's IE history and mail it to me, so I
> can make sure he isn't learning more about sex than I know?

It's too late - 12/13 yr olds already know more than we do<g>

I just checked the history object and it will not solve your issue - it only gives a history of the current
session.

Maybe we have do have to walk the folder of the cache, although that doesn't look easy either, everthing
under history appears to be encrypted.

hmmm! I have 3 early teenagers too - I'll be interested if you find anything.

Brian


Re: Getting the entire Internet Explorer history by Christoph

Christoph
Fri May 21 16:10:53 CDT 2004

21.05.2004 16:49, Leslie Houk schrieb:

> So there's no easy way to write a VBScript program that would dump
> the contents of my 12-year-old son's IE history and mail it to me, so I
> can make sure he isn't learning more about sex than I know?

You can browse the history of IE by looping through
FolderItems of the History-ShellFolder using GetDetailsOf
to get some info on URLs, Websites and Dates where the
URLs have been visited:


const dump_file_name = "history_dump.txt"
const dump_dir = "C:\"

with createobject("Scripting.FileSystemObject")
set dump = .createtextfile(dump_dir & dump_file_name,true,0)
end with

set sh = createobject("Shell.Application")
const ssfHISTORY = 34
set history = sh.NameSpace(ssfHISTORY)
'first level items a grouped by date
'(today, yesterday, last week)
for each item in history.items
dump.WriteLine history.GetDetailsOf(item,-1)
dump.WriteBlankLines 1
if item.isFolder then
set itFol = item.GetFolder
for each item2 in itFol.items
dump.WriteLine vbtab & itFol.GetDetailsOf(item2,-1)
dump.WriteBlankLines 1
if item2.isFolder then
set itFol2 = item2.GetFolder
for each item3 in itFol2.items
url = itFol2.GetDetailsOf(item3,0)
title = itFol2.GetDetailsOf(item3,1)
date_vis = itFol2.GetDetailsOf(item3,2)
dump.WriteLine String (3,vbtab) & date_vis & " : " & title
dump.WriteLine String (3,vbtab) & url
dump.WriteBlankLines 1
Next
end if
Next
dump.WriteLine String (80,"*")
dump.WriteBlankLines 1
end if
next
dump.close()

'open textfile
sh.namespace(dump_dir).parsename(dump_file_name).InvokeVerb()

--
Gruesse, Christoph

Re: Getting the entire Internet Explorer history by Brian

Brian
Fri May 21 17:28:44 CDT 2004

Christoph,

Wow! cool

thanks - Brian


Re: Getting the entire Internet Explorer history by Michael

Michael
Fri May 21 20:15:17 CDT 2004

> It's too late - 12/13 yr olds already know more than we do<g>

ROFLMAO!!!!!!

--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US

Re: Getting the entire Internet Explorer history by Michael

Michael
Fri May 21 20:23:24 CDT 2004

> You can browse the history of IE by looping through
> FolderItems of the History-ShellFolder using GetDetailsOf
> to get some info on URLs, Websites and Dates where the
> URLs have been visited:


Copy, paste, save... That one's a keeper!


--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US

Re: Getting the entire Internet Explorer history by lhouk

lhouk
Sun May 23 15:12:56 CDT 2004

Christoph Basedau <e_tonne@hotmail.com> wrote in message news:<40ae7097$0$26367$9b4e6d93@newsread4.arcor-online.net>...

>
> You can browse the history of IE by looping through
> FolderItems of the History-ShellFolder using GetDetailsOf
> to get some info on URLs, Websites and Dates where the
> URLs have been visited:
>

Thanks, Christoph! Your script, combined with Lee Jones' example
of sending email using MAPI in the first post of the "vbscript
attempt to send email" thread, should be enough to let me write
my program.

Leslie

Re: Getting the entire Internet Explorer history by Brian

Brian
Mon May 24 14:12:57 CDT 2004

Leslie,

> Lee Jones' example
> of sending email using MAPI in the first post of the "vbscript
> attempt to send email" thread,

I cant find this thread anywhere on any MS NG`s. Can you re-post here or
provide more clues where to find it?

thanks - Brian


Re: Getting the entire Internet Explorer history by lhouk

lhouk
Tue May 25 10:05:58 CDT 2004

Brian Staff <brianstaff@[NoSpam]compuserve.com> wrote in message news:<VA.00000276.430e8737@bstaffw2k>...
> Leslie,
>
> > Lee Jones' example
> > of sending email using MAPI in the first post of the "vbscript
> > attempt to send email" thread,
>
> I cant find this thread anywhere on any MS NG`s. Can you re-post here or
> provide more clues where to find it?
>
> thanks - Brian

Sure, the URL for the post in Google Groups is:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=eUWB3DPqAHA.2100%40tkmsftngp05

Hope this helps! BTW, would anyone want me to post my program when
I get it finished? I warn you, my code usually isn't pretty! <grin>

Leslie

Re: Getting the entire Internet Explorer history by lhouk

lhouk
Thu Jun 17 09:34:46 CDT 2004

Brian Staff <brianstaff@[NoSpam]compuserve.com> wrote in message news:<VA.00000274.338dfc26@bstaffw2k>...
> Leslie,
>
> > Hmm. So there's no easy way to write a VBScript program that would dump
> > the contents of my 12-year-old son's IE history and mail it to me, so I
> > can make sure he isn't learning more about sex than I know?
>
> hmmm! I have 3 early teenagers too - I'll be interested if you find anything.
>
> Brian

Brian,

This is what I finally came up with. I've been using it for a week or
so, and I've been getting an email every time my son logs in, since I
put it in his Startup folder. Hope you find it useful,

Leslie

----- cut here -----

Option Explicit
On Error Resume Next

Const READONLY = 1
Const MAX_BUFFER_SIZE = 32000

Dim objWShell, objFileSys, objFile, strUserProfile, strHistoryFile
Dim strSchema, objConfig, objMessage, objPOP3, Server
Dim strFrom, strTo, strSubject, strServer, strPassword
Dim strCommand, strURL, strOldURL, strBuffer, strByte
Dim intByteCode, intURLCount, intBufLen, intNewURL, intIndex, intI
Dim strURLList()

' Set these to the correct values for you
strFrom = "sender@yourISP.com"
strTo = "recipient@yourISP.com"
strServer = "yourISP.com"
strPassword = "yourPassword"

Set objWShell = CreateObject( "WScript.Shell" )
strUserProfile = objWShell.ExpandEnvironmentStrings( "%USERPROFILE%" )
strHistoryFile = strUserProfile & _
"\Local Settings\Temporary Internet Files\Content.IE5\index.dat"

Set objFileSys = CreateObject( "Scripting.FileSystemObject" )
If objFileSys.FileExists( strHistoryFile ) Then
' ' Scan the history file for URLs
Set objFile = objFileSys.OpenTextFile( strHistoryFile, READONLY )
intIndex = MAX_BUFFER_SIZE
intBufLen = MAX_BUFFER_SIZE
ReDim strURLList(0)
intNewURL = 0
Do
strByte = NextByte( strBuffer, intBufLen, intIndex )
For intI = 1 To 7
If strByte = Mid( "http://", intI, 1 ) Then
If intI < 7 Then
strByte = NextByte(strBuffer, intBufLen, intIndex)
Else
strURL = "http://"
strByte = NextByte(strBuffer, intBufLen, intIndex)
intByteCode = Asc( strByte )
' ' Read URL, omitting trailing parameters
Do While intByteCode > 31 And intByteCode <> 34 _
And strByte <> "?"
strURL = strURL & strByte
strByte = NextByte( strBuffer, intBufLen, _
intIndex )
intByteCode = Asc( strByte )
Loop
intNewURL = 1
End If
Else
Exit For
End If
Next
If intNewURL = 1 Then
' ' Truncate long URLs
strURL = Left( strURL, 72 )
' ' Skip immediately duplicated URLs
If strOldURL <> strURL Then
intURLCount = UBound( strURLList ) + 1
ReDim Preserve strURLList( intURLCount )
strURLList( intURLCount ) = strURL
strOldURL = strURL
End If
intNewURL = 0
End If
Loop Until objFile.AtEndOfStream

objFile.Close
Set objFile = Nothing
Set objFileSys = Nothing

' ' Clean cache using Marty List's IECache.exe:
' ' http://www.optimumx.com/download/
objWShell.Run "C:\Progra~1\IECache.exe /DELETE", 0, True

' ' Since my ISP requires POP3-before-SMTP, do a POP3 login
' ' using Simon Fell's Zaks.POP3 module:
' ' http://www.zaks.demon.co.uk/code/cpts/pop/index.html
Set objPOP3 = CreateObject( "zakspop3.Server" )
objPOP3.mailServerHost = "pop." & strServer
objPOP3.mailAccount = strFrom
objPOP3.mailPassword = strPassword
If Not objPOP3.Login Then
WScript.Echo( "POP3 login to pop." & strServer & " failed." )
' ' Give me time to read the error message
WScript.Sleep 10000
WScript.Quit( 7 )
End If

strSchema = "http://schemas.microsoft.com/cdo/configuration/"
Set objConfig= CreateObject( "CDO.Configuration" )
objConfig.Fields.Item( strSchema & "sendusing" ) = 2
objConfig.Fields.Item( strSchema & "smtpserverport" ) = 25
objConfig.Fields.Item( strSchema & "smtpserver" ) = "smtp." & _
strServer
objConfig.Fields.Item( strSchema & "smtpauthenticate" ) = 1
objConfig.Fields.Item( strSchema & "sendusername" ) = strFrom
objConfig.Fields.Item( strSchema & "sendpassword" ) = strPassword
objConfig.Fields.Update

set objMessage = CreateObject( "CDO.Message" )
objMessage.Configuration = objConfig
objMessage.From = strFrom
objMessage.To = strTo
intIndex = InStrRev( strUserProfile, "\" ) + 1
objMessage.Subject = "URLs accessed by " & Mid( strUserProfile, _
intIndex )

objMessage.TextBody = Join( strURLList, vbCrLf )
For intIndex = 1 To 3
WScript.Sleep 5000
intI = objMessage.Send
If intI = 0 Then
Set objMessage=Nothing
Set objConfig=Nothing
Set objWShell = Nothing
WScript.Quit( 0 )
End If
Next
WScript.Echo( "objMessage.Send returned " & intI )
WScript.Echo( "Error Number: " & Err.Number )
WScript.Echo( "Error Description: " & Err.Description )
' ' Give me time to read the error message
WScript.Sleep 10000
Set objMessage=Nothing
Set objConfig=Nothing
Set objWShell = Nothing
WScript.Quit( 3 )
Else
WScript.Echo( "Can not read history file:" & vbCrLf & _
" " & strHistoryFile )
' ' Give me time to read the error message
WScript.Sleep 10000
WScript.Quit( 5 )
End If

' ===== SUBROUTINES AND FUNCTIONS =====

Function NextByte( strBuffer, intBufLen, intIndex )

If intIndex = intBufLen Then
strBuffer = objFile.Read( MAX_BUFFER_SIZE )
intIndex = 1
intBufLen = Len( strBuffer )
Else
intIndex = intIndex + 1
End If
NextByte = Mid( strBuffer, intIndex, 1 )

End Function

Re: Getting the entire Internet Explorer history by Brian

Brian
Thu Jun 17 12:20:10 CDT 2004

Leslie,,

> This is what I finally came up with. I've been using it for a week or
> so, and I've been getting an email every time my son logs in, since I
> put it in his Startup folder. Hope you find it useful,

Cool! - Thanks very much

Brian