Automatically erase traces of the Internet with logoff scripts

Source: Internet
Author: User
Tags key window

After surfing the internet, the system will always leave a lot of garbage to be cleaned up, including ie temporary files, historical records, cookies and so on. If you use manual method to clear each time is more troublesome, in fact, we can only use the Windows 2000/XP shutdown and logoff scripts to achieve automatic cleanup.

Clear IE Temp file

To speed up access, IE will store Web pages that have been browsed in the temporary Internet files folder. If we don't want people to peek at their secrets from here, you can use a shutdown script to get the system cleaned up before shutting down, and here's how to do it (take Windows XP for example).

Under the "C:windowssystem32grouppolicymachinescriptsshutdown" directory, create a new batch file Cleanup.bat, which can be written as needed. The command to clear the IE temporary file is "del/q/s" c:documents and settings< user name >local settingstemporary Internet Files "". where parameter/q indicates the use of quiet mode, that is, when the global wildcard is deleted, no acknowledgement is required, and the parameter/s represents the deletion of the file from all subdirectories.

Click Start to run, enter gpedit.msc in the Run Command box, and open the Group Policy window. In the console tree pane on the left, expand the Computer Configuration Windows Settings script (start/Shutdown) node in turn (Figure 1), double-click the shutdown item in the right details pane, and click the Add button in the pop-up Shutdown Properties dialog box. Add Cleanup.bat as a new computer shutdown script. When the settings are complete, quit the Group Policy window and restart the computer.

    

Figure 1 Specific settings

Remove cookies

Cookies are small text files that are used to store information such as Web addresses, login usernames, passwords or personal data, and identity. Cookies make it easier for us to log on to certain websites, but at the same time it is easy to disclose the privacy of the individual, so it is necessary to clean the cookies in the computer in time. Add the order to remove Cookies from the cleanup.bat batch file "del/q" C:documents and settings< username >cookies "".

Clear IE history

The usual way to clear IE history is Internet options, general, purge history. However, we can also use shutdown scripts to automate cleanup. Add a command "del/q/s" c:documents and settings< user name >local settingshistory "" In the Cleanup.bat batch file that was established earlier.

Clear IE Address bar record

Previously cleared IE history is not thorough enough, when we enter the IE address bar with the same URL of the same string, will still show the relevant web site records. To clear these records, you must delete all the key values under the registry [hkey current usersoftwaremicrosoftinternet explorertypedurls] branch.

Create a script file with Notepad, and the script reads as follows:

Dim WshShell

Set WshShell = WScript.CreateObject ("Wscript.Shell")

WshShell.RegWrite "Hkcusoftwaremicrosoftinternet explorertypedurls", "Wshshell.regdelete" Hkcusoftwaremicrosoftinternet Explorertypedurls "The above script has a total of four sentences: The first sentence defines a variable WshShell, the second sentence creates an object, and the third sentence writes to the registry, if the key is not present in the registry, An error message appears when executing the script. When you enter the above content, save it as a cleanup.vbs. Note that the suffix name must be a VBS to ensure that the script executes correctly.

When you are finished writing, expand the User Configuration Windows Settings script (Logon/Logoff) node in the Group Policy window in turn. Double-click the logout item in the right pane and click the Add button in the Logout Properties dialog box that pops up, adding cleanup.vbs as a logoff script (Figure 2). In this way, the IE Address bar record is automatically cleared when the computer logs off or shuts down.

  

Figure 2 Add as Logoff script

The previous method of using shutdown and logoff scripts to automatically clean the traces of the Internet, if you have other items to clean up, you can also refer to the above method. This is to remind the reader that the use of scripting to automate cleaning before, it is best to manually clean up the first time.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.