萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 電腦基礎知識 >  >> 健康知識

保護隱私:徹底清除電腦中洩密痕跡(Recent、Temp、History、Cookies、Registry)

兩大洩密溫床:資料夾與註冊表

  • 資料夾:最近文件 C:\Windows\Recent、暫存檔 C:\Windows\Temp、回收站 C:\RECYCLED、瀏覽歷史 C:\Windows\History、暫存網頁檔 C:\Windows\Temporary Internet Files、Cookies C:\Windows\Cookies。
  • 註冊表:IE 位址列輸入紀錄、網路實名等。

自動化清理方案:VBScript + 批次檔

1. VBScript (reg.vbs) 清理註冊表

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
' 設定開機自動執行本腳本與批次檔
WSHShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\reg", "reg.vbs"
WSHShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce\deldel", "reg.bat"
' 還原 IE 首頁
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", "about:blank"
' 清除 IE 位址列歷史
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs", ""
WSHShell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\TypedURLs"
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs", ""
' 清除網路實名 (3721)
WSHShell.RegWrite "HKCU\Software\3721\InputCns", ""
WSHShell.RegDelete "HKCU\Software\3721\InputCns"
WSHShell.RegWrite "HKCU\Software\3721\InputCns", ""

關鍵語法: RegWrite 建立鍵/值,RegDelete 刪除鍵/值;HKLM=HKEY_LOCAL_MACHINE,HKCU=HKEY_CURRENT_USER;鍵名以 \ 結尾為主鍵,否則為鍵值。執行前請備份註冊表。

2. 批次檔 (reg.bat) 清理資料夾

@deltree -y c:\windows\temp\*.*
@deltree -y c:\windows\Temporary Internet Files\*.*
@deltree -y c:\windows\History\*.*
@deltree -y C:\Windows\Recent\*.*
@deltree -y C:\RECYCLED\*.*
@deltree -y C:\WINDOWS\Cookies\*.*

依序清除:暫存檔、暫存網頁檔、歷史、最近文件、回收站、Cookies。

3. 部署方式

將兩檔複製至 C:\Windows,雙擊 reg.vbs 執行一次,以後每次開機自動完成清理。

進階:純 VBScript 實現(避免批次檔權限錯誤)

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder "C:\WINDOWS\Cookies\*.*", True
fso.DeleteFile "C:\WINDOWS\Cookies\*.*", True
fso.DeleteFolder "C:\WINDOWS\History\*.*", True
fso.DeleteFile "C:\WINDOWS\History\*.*", True
fso.DeleteFolder "C:\WINDOWS\Temp\*.*", True
fso.DeleteFile "C:\WINDOWS\Temp\*.*", True
fso.DeleteFolder "C:\RECYCLED\*.*", True
fso.DeleteFile "C:\RECYCLED\*.*", True
fso.DeleteFolder "C:\WINDOWS\Temporary Internet Files\*.*", True
fso.DeleteFile "C:\WINDOWS\Temporary Internet Files\*.*", True

將以上內容附加在 reg.vbs 末尾即可,免受 deltree 權限/相容性問題困擾。

結語

公用電腦操作完畢,執行此腳本即可一鍵抹除隱私痕跡。原理透徹、擴展性強,讀者可觸類旁通,加入更多清理目標(如 Office 最近檔案清單、媒體播放器歷史等),打造專屬隱私保護工具。

copyright © 萬盛學電腦網 all rights reserved