清理COOKIS 上网痕迹
王艳娇 2014-01-23 09:52:25
@echo off
TITLE 清理上网痕迹
color 0b
MODE con: COLS=60 LINES=30
set path=%path%;%windir%\system32
echo 正在检测环境............
echo.
for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ^|find /i
"history"') do set _history=%%a
for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ^|find /i
"Cookies"') do set _Cookies=%%a
for /f "tokens=3,*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ^|find /i
"Cache"') do (
dir "%%a %%b" >nul&& set _Cache=%%a %%b|| set _Cache=%userprofile%\Local Settings\Temporary Internet Files)
for /f "tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Internet Explorer" /v "version"^|find /i "reg_sz"') do set
_IEversion=%%a
call :ver %_IEversion%
echo %_IEversion%|find /i "6.0" >nul &&set _goto=ie6&&goto :ie6
echo %_IEversion%|find /i "7.0" >nul &&set _goto=ie7&&call :ie7
:echo %_IEversion%|find /i "8.0" >nul &&set _goto=ie8
:for /f "tokens=3" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ^|find /i
"Cookies"') do echo %%a
for /f "tokens=4 " %%i in ('dir /ah "%_history%\History.IE5\" ^| findstr /i /c:"MSHist"') do set _MSHist=%%i
:********************************************
:********************************************
:echo ::%_history%
:echo ::%_Cookies%
:echo ::%_Cache%
:echo ::%_MSHist%
:echo ::%_IEversion%
:echo ::%_goto%
:********************************************
:ie6
if "%_goto%"=="ie6" TASKKILL /F /t /IM iexplore.exe >nul 2>nul
if "%_goto%"=="ie6" TASKKILL /F /IM explorer.exe >nul
ping 127.1 -n 3 >nul
attrib "%_Cache%\Content.IE5\index.dat" -s -r -h
del "%_Cache%\Content.IE5\index.dat"
attrib "%_history%\History.IE5\index.dat" -s -r -h
del "%_history%\History.IE5\index.dat"
attrib "%_history%\History.IE5\%_MSHist%\index.dat" -s -r -h
del "%_history%\History.IE5\%_MSHist%\index.dat"
attrib "%_Cookies%\index.dat" -s -r -h
del "%_Cookies%\index.dat"
if "%_goto%"=="ie6" start explorer.exe >nul
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /F >NUL 2>NUL
reg delete "HKCU\Software\Microsoft\Internet Explorer\TypedURLs" /F >NUL 2>NUL
del /f /s /q "%_Cache%\Content.IE5\*.*"
del /f /s /q "%_Cache%\*.*"
del /f /s /q "C:\WINDOWS\Downloaded Program Files"
del /f /s /q "%_history%\*.*"
del "%USERPROFILE%"\Recent\. /f /s /q
rd "%temp%" /s /q
goto end
:**********************************************************************************************
:ie7
:ie8
:ie9
:**********************************************************************************************
::↓清除IE临时文件
start rundll32 InetCpl.cpl,ClearMyTracksByProcess 8
::↓清除Cookies
start rundll32 InetCpl.cpl,ClearMyTracksByProcess 2
::↓清除历史记录
start rundll32 InetCpl.cpl,ClearMyTracksByProcess 1
::↓清除表单数据
:start rundll32 InetCpl.cpl,ClearMyTracksByProcess 16
::↓清除密码
:start rundll32 InetCpl.cpl,ClearMyTracksByProcess 32
::↓清除上述全部项目
:start rundll32 InetCpl.cpl,ClearMyTracksByProcess 255
::↓清除上述全部项目,以及IE7中使用的加载项所保存的各种数据
:start rundll32 InetCpl.cpl,ClearMyTracksByProcess 4351
GOTO :EOF
:**********************************************************************************************
:ver
:**********************************************************************************************
echo 当前Internet Explorer版本为:%1
GOTO :EOF
:**********************************************************************************************
:**********************************************************************************************
pause
:end
请高手解释一下这段批处理代码,还有为什么不能自动跳转到相应的IE版本执行清理。