Introduction

This VBScript sample shows how to export the history of Internet Explorer to CSV file.

 

Scenarios

Although Internet Explorer has an option to view the history, there is limited option to manage history of visited URLs. This script can help user export the history of Internet Explorer to CSV file.

 

Script

Step1: Double-click ExportIEHistoryToCSV.vbs to run this VBScript sample. The step is shown in the following figure.

When the script finishes running, a dialog box will appear that displays brief information about the execution result of the script.

Then you can open this csv file to see the following information.

Here are some code snippets for your reference.

 

VB Script
Edit|Remove
For Each objPeriod In objHistory.Items  
    If objPeriod.Name = "Today" Then 
        If objPeriod.IsFolder Then  
            Set objSiteFolder = objPeriod.GetFolder  
            For Each objSite In objSiteFolder.Items  
                If objSite.IsFolder Then  
                    Set objPageFolder = objSite.GetFolder        
                    For Each objPage In objPageFolder.Items  
                        strURL = objPageFolder.GetDetailsOf(objPage,0)  
          
                        strDateVisited = objPageFolder.GetDetailsOf(objPage,2)  
           
                        objLogFile.Write """" & objSite.Name & """,""" & strURL & """,""" & strDateVisited & """,""" & objPeriod.Name & """" 
                        objLogFile.WriteLine 
                    Next  
                End If  
            Next  
        End If  
        WScript.Echo "Successfully exported history of Internet Explorer." 
  End If 
Next