JSI Tip 9252. How can I set the number of days worth or URL history to keep?

Jerold Schulman

April 12, 2005

1 Min Read
ITPro Today logo in a gray background | ITPro Today


When you use the Internet Explorer Tools menu to open Internet Options, the General tab allows you to configure Days to keep pages in history.

You can change this value in a batch, or logon script, by setting the DaysToKeep Value Name, a REG_DWORD data type, at HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsUrl History.

Examples of setting DaysToKeep to 3:

Using REG.EXE, built into Windows XP, Windows Server 2003, and later, or installed from the Windows 2000 Support Tools on the operating system CD-ROM:

REG ADD "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet SettingsUrl History" /V DaysToKeep /T REG_DWORD /F /D 3

Using REGEDIT.EXE:

Regedit /s FileName.reg

Where FileName.reg contains:

REGEDIT4[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsUrl History]"DaysToKeep"=dword:00000003

Using a batch to generate a .REG file:

@echo offsetlocalset rf="%TEMP%DaysToKeep_%RANDOM%.TMP"(@echo REGEDIT4@echo.@echo [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsUrl History]@echo "DaysToKeep"=dword:00000003@echo.)>%rf%regedit /s %rf%del /q %rf%endlocal



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like