Cleaning up Windows 2k at logoff
I have been digging around for a while to find ways to automate cleaning up a user session of win 2k to hide opened files and wipe cache at logoff. I would love to hear any suggestions on how to do it better. Here is what I have so far.:
First, add this to the registry(create text file, paste, save as .reg, double click):
----------------------------------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:00000095
"NoRecentDocsHistory"=hex:01,00,00,00
---------------------------------------------------------
That prevents office MRU and Documents on the start menu from showing anything as well as in office progs.
Next create a Batch file to run eraser and to clean some registry settings using a script:
BATCH:
----------------------------------
cd c:\Documents and Settings\[USERNAME]
c:\progra~1\eraser\eraserd -folder Cookies -subfolders -keepfolder -passes 7
c:\progra~1\eraser\eraserd -folder Locals~1\temp -subfolders -keepfolder -passes 7
c:\progra~1\eraser\eraserd -folder Locals~1\Tempor~1 -subfolders -keepfolder -passes 7
c:\progra~1\eraser\eraserd -folder Recent -subfolders -keepfolder -passes 7
c:\progra~1\eraser\eraserd -folder UserData -subfolders -keepfolder -passes 7
c:\progra~1\eraser\eraserd -folder Micros~1\Office\Recent -subfolders -keepfolder -passes 7
c:\delMRUs.vbs
----------------------------------------
The delMRUs.vbs:
----------------------------------
'MRU Cleaner
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Explorer Bars\{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}\ContainingTextMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Explorer Bars\{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}\FilesNamedMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Microsoft Management Console\Recent File List\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CopyMoveTo\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\DesktopStreamMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU\"
DelKey()
RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\"
DelKey()
RegKey = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\MediaPlayer\Player\RecentFileList\"
DelKey()
WScript.Quit() ' All Done
Sub DelKey()
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
On Error Resume Next
WshShell.RegDelete RegKey
On Error GoTo 0
End Sub
---------------------------------
Put the batch and the script in the c: root and add the batch to the system policy for logoff script and voila! Of course you have to have eraser and may need to change paths for your own config.
Cheers!