After surfing the Internet, there will always be a lot of garbage left in the system, including IE temporary files, history, and CookIEs. If you use the manual method to clear each time, it is more troublesome. In fact, we can use the shutdown and logout scripts of Windows 2000/XP to achieve automatic cleaning.
Clear IE temporary files
In order to speed up access, IE will store the contents of the webpages and other content that have been viewed in the Temporary Internet Files folder. If we don't want others to peek into our secrets from here, we can use the shutdown script to let the system automatically clean up before shutting down. Here is a description of the specific operations (Windows XP as an example).
In the "C:\\Windows\\System32\\GroupPolicy\\Machine\\Scripts\\Shutdown" directory, create a new batch file Cleanup.bat, the content can be written as needed. The command to clear the IE temporary file is "DEL/Q/S "C:\\Documents and Settings\\<username>\\Local Settings\\Temporary Internet Files"". The parameter /Q indicates that the quiet mode is used, that is, when the global wildcard is deleted, no confirmation is required; the parameter /S indicates that the file is deleted from all subdirectories.
Click "Start" "Run", enter "Gpedit.msc" in the run command box to open the Group Policy window. In the console tree pane on the left, expand the Computer Configuration Windows Settings Script (Startup/Shutdown) node (Figure 1), and double-click the Shut Down item in the details pane on the right. In the pop-up "Shutdown Properties" dialog box, click the "Add" button to add Cleanup.bat as a new computer shutdown script. After the setup is complete, exit the Group Policy window and restart your computer.
Figure 1
Clear CookIEs
Cookies are small text files, such as to save the URL, login user name, password or personal information, identification and other information. Cookies can make it easier for us to log in to certain websites, but at the same time, it is easy to cause personal privacy to leak, so it is necessary to clean up the cookies in the computer in time. Add the command "DEL/Q "C:\\Documents and Settings\\<username>\\CookIEs"" to clear the cookies in the Cleanup.bat batch file.
Clear IE History
The usual way to clear IE history is "Internet Options" "General" "Clear History". However, we can also use the shutdown script to achieve automatic cleanup. Add a command "DEL/Q/S "C:\\Documents and Settings\\<username>\\Local Settings\\History"" to the Cleanup.bat batch file created earlier.
Clear IE address bar record
The previously cleared IE history is not complete enough. When we enter the same string as the URL we have entered in the IE address bar, it will still be displayed. Relevant URL records. To clear these records, you must delete all key values under the registry [HKEY CURRENT USER\\Software\\Microsoft\\Internet Explorer\\TypedURLs] branch.
Create a script file with Notepad, the script content is as follows:
Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\\Software\\Microsoft\\Internet Explorer\\TypedURLs\\", ""WSHShell.RegDelete "HKCU\\Software\\Microsoft\\Internet Explorer\\TypedURLs\\"The above script has four sentences: the first sentence defines a variable WSHShell, The second sentence creates an object, and the third sentence is written to the registry. If the item does not exist in the registry, an error message will appear when executing the script. Save the above as Cleanup.vbs after entering the above. Note that the suffix must be vbs in order to ensure the normal execution of the script.
After writing, expand the "User Configuration" "Windows Settings" "Script (Login /Logout)" node in the Group Policy window, double-click the "Logout" item in the right pane, pop up Click the "Add" button in the "Logout Properties" dialog box to add Cleanup.vbs as a logout script (Figure 2). This will automatically clear the IE address bar record when the computer logs out or shuts down.
Figure 2
The previous method of using the shutdown and logout script to automatically clean up the Internet traces, if you have other projects need to be cleaned up, you can also refer to the above method. Here to remind the reader that before using the script to achieve automatic cleaning, it is best to clean it manually by hand.