Part of Internet Explorer’s AutoComplete feature involves the web addresses that you type into the Address bar. When you start typing a URL in the Address bar, Internet Explorer displays a list of addresses that match what you’ve typed. If you see the one you want, use the arrow keys to select it and then press Enter to surf to it.
That’s mighty convenient, but not very private since other people who have access to your PC can also see those addresses. So a good privacy tweak is to clear the Address bar list so that no URLs appear as you type.
One way to clear the Address bar list is to clear the history files. That is, (in IE 7) you select Tools, Delete Browsing History, and then click Delete History.
That works well, but it also means that you lose all your browsing history. That may be exactly what you want, but you may prefer to preserve the history files. In this post I show you a script that removes the Address bar URLs but lets you save your history.
First, note that Internet Explorer stores the last 25 typed URLs in the following Registry key:
HKCUSoftwareMicrosoftInternet ExplorerTypedURLs
You can therefore clear the Address bar list by closing all Internet Explorer windows and deleting the settings url1 through url25 in this key. Here’s a script that does this for you:
Option Explicit
Dim objWshShell, nTypedURLs, strRegKey, i
Set objWshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
'
' Initialize some variables
'
nTypedURLs = 0
strRegKey = "HKCUSoftwareMicrosoftInternet ExplorerTypedURLs"
'
' Run through the typed URLs
'
For i = 1 to 25
'
' Delete the Registry setting
'
objWshShell.RegDelete strRegKey & "url" & i
'
' If we get an error, it means the current
' typed URL doesn't exist, so exit the loop
'
If Err 0 Then
Exit For
End If
nTypedURLs = nTypedURLs + 1
Next 'i
objWshShell.Popup "Finished deleting " & nTypedURLs & _
" typed URLs", , "Delete Typed URLs"
This script uses the RegDelete method to delete Registry settings. The For…Next loop runs through i from 1 to 25, and uses each new value of i to delete the next setting in the TypedURLs key. Since there may not be the full 25 typed URLs in the key, the script checks for an error (which gets raised if you try to delete a non-existent Registry setting) and, if it gets one, it exits the loop.




