'Remove Clear Recent Items Key
On Error Resume Next

Dim WshShell, Message, M
 
If WScript.Arguments.length = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", """" & _
WScript.ScriptFullName & """" & " uac","", "runas", 1
Else
Message = "This script will remove the registry key for Recent Items." & vbCr _
 & "Recent Items will no longer be deleted at LogOff." & vbCr & vbCr _
 & "Adding information can unintentionally change or delete values and cause components to stop working correctly." _
 & "  If you do not trust the source of this information, do not add it to the registry."  & vbCr  & vbCr _
 & "Would you like to continue?"

M = MsgBox(Message, vbYesNo + vbInformation, "Paul's XP and Vista Tweaks")
If M = 6 Then 

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\ClearRecentDocsOnExit"

Message = "The registry entry has been removed." & vbCr & vbCr _
 & "This script was downloaded from www.paulsxp.com"
MsgBox Message,16,"Done!"
End If
End If
