Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

利用登出/關機腳本自動清除 IE 暫存檔、Cookies、歷史記錄、位址列記錄

編輯:XP 系統基礎知識

手動清理上網痕跡繁瑣,善用 Windows 2000/XP 群組原則的關機/登出腳本自動化:

1. 清除 IE 暫存檔、Cookies、歷史記錄 (關機腳本 .bat)

在 C:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown 建立 Cleanup.bat:

DEL /Q /S "C:\Documents and Settings\<用戶名>\Local Settings\Temporary Internet Files"
DEL /Q "C:\Documents and Settings\<用戶名>\Cookies"
DEL /Q /S "C:\Documents and Settings\<用戶名>\Local Settings\History"

/Q 安靜模式、/S 遞迴子目錄。
gpedit.msc → 電腦設定 → Windows 設定 → 指令碼 (啟動/關機) → 關機 → 新增 Cleanup.bat → 重開機生效。

2. 清除 IE 位址列記錄 (登出腳本 .vbs)

註冊表機碼 HKCU\Software\Microsoft\Internet Explorer\TypedURLs 需用 VBScript 操作。建立 Cleanup.vbs:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\", ""
WSHShell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\"

gpedit.msc → 用戶設定 → Windows 設定 → 指令碼 (登入/登出) → 登出 → 新增 Cleanup.vbs。登出/關機時自動清除位址列下拉記錄。

建議

部署腳本前,先手動徹底清理一次,確保起始環境乾淨。

Copyright © Windows教程網 All Rights Reserved