2009-02-02 60 views
4

我用下面的腳本刪除瀏覽歷史記錄中的IE 7.0使用腳本

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 

但現在我需要一個腳本清除的Internet Explorer 6.0瀏覽歷史記錄清除IE 6.0瀏覽歷史記錄

我得到一個錯誤,「缺少條目ClearMyTracksByProcess」我已經通過不同的參數,如2,5等,並沒有成功。

回答

3
// test.cpp : Defines the entry point for the console application. 
// 

#include "stdafx.h" 
#include "test.h" 
#include <shlguid.h> // Needed for CLSID_CUrlHistory 
#include <urlhist.h> // Needed for IUrlHistoryStg2 and IID_IUrlHistoryStg2 

#ifdef _DEBUG 
#define new DEBUG_NEW 
#endif 


// The one and only application object 

CWinApp theApp; 

using namespace std; 

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) 
{ 
    int nRetCode = 0; 

    // initialize MFC and print and error on failure 
    if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) 
    { 
     // TODO: change error code to suit your needs 
     _tprintf(_T("Fatal Error: MFC initialization failed\n")); 
     nRetCode = 1; 
    } 
    else 
    { 
     // TODO: code your application's behavior here. 

     IUrlHistoryStg2* pHistory; // We need this interface for clearing the history. 
     HRESULT hr; 
     DWORD cRef; 
     CoInitialize(NULL); 
     // Load the correct Class and request IUrlHistoryStg2 
     hr = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER, 
     IID_IUrlHistoryStg2, reinterpret_cast<void **>(&pHistory)); 

     if (SUCCEEDED(hr)) 
     { 
     // Clear the IE History 
     hr = pHistory->ClearHistory(); 
     } 
     // Release our reference to the 
     cRef = pHistory->Release(); 
     CoUninitialize(); 
    } 

    return nRetCode; 
} 
2

由於隨Internet Explorer 7附帶的INETCPL.CPL version 7.0確實有一個名爲ClearMyTracksByProcessW的入口點,它可能不在IE6中。

因此可能是一個腳本是一個更基本的解決方案:

@ECHO OFF 
ECHO * Cleaning Current User's Temp Folders * 
FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Cookies\*.*" 
FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Local Settings\Temp\*.*" 
FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Local Settings\History\*.*" 
FOR /D %%G IN ("C:\Documents and Settings\*.*") DO DEL/S/Q/F "%%G\Local Settings\Temporary Internet Files\*.*" 
Echo * Done * 
PAUSE 
CLS 

(你可以只保留「刪除」你的興趣在這個腳本)

然而,隨着reported in this thread,也可以不足夠。


其他唯一的解決辦法是使用(免費)的第三方工具:

alt text http://www.ccleanerbeginnersguide.com/ccleanerhelp.pngCCleaner

其他選項mentionned in this thread

0

ClearMyTracks()不是IE6的一部分,所以你不能做同樣的伎倆。

如果您只想清除歷史記錄,您可以編寫一個只是CoCreates(CLSID_CUrlHistory,IID_IUrlHistoryStg2)的小程序,然後致電IUrlHistoryStg::ClearHistory()

應該可以從VBScript中完成,但我不知道正確的mojo。

0

壞消息民間的

試圖刪除使用ClearMyTracksByProcess互聯網歷史上的Win 7與IE8/9不再工作,你只可以通過運行DOS在啓動時,因爲微軟使用刪除命令清除一些文件超級隱藏的文件夾,鎖定文件,這是一個大混亂,擾亂大哥。

此代碼清除IE8/9加FireFox和共享對象/閃存cookie,但如果您要刪除Index.dat文件,然後單擊我的名稱以查看代碼。

using System; 
using System.Collections.Generic; 
using System.IO; 
using System.Diagnostics; 
using System.Text; 

namespace Fidling 
{ 
    public static class SpywareRemoval 
    { 
     private static void RemoveSpywareFiles(string RootPath, string Path,bool Recursive) 
     { 
      string FullPath = RootPath + Path + "\\"; 
      if (Directory.Exists(FullPath)) 
      { 
       DirectoryInfo DInfo = new DirectoryInfo(FullPath); 
       FileAttributes Attr = DInfo.Attributes; 
       DInfo.Attributes = FileAttributes.Normal; 
       foreach (string FileName in Directory.GetFiles(FullPath)) 
       { 
        RemoveSpywareFile(FileName); 
       } 
       if (Recursive) 
       { 
        foreach (string DirName in Directory.GetDirectories(FullPath)) 
        { 
         RemoveSpywareFiles("", DirName, true); 
         try { Directory.Delete(DirName); }catch { } 
        } 
       } 
       DInfo.Attributes = Attr; 
      } 
     } 

     private static void RemoveSpywareFile(string FileName) 
     { 
      if (File.Exists(FileName)) 
      { 
       try { File.Delete(FileName); }catch { }//Locked by something and you can forget trying to delete index.dat files this way 
      } 
     } 

     private static void DeleteFireFoxFiles(string FireFoxPath) 
     { 
      RemoveSpywareFile(FireFoxPath + "cookies.sqlite"); 
      RemoveSpywareFile(FireFoxPath + "content-prefs.sqlite"); 
      RemoveSpywareFile(FireFoxPath + "downloads.sqlite"); 
      RemoveSpywareFile(FireFoxPath + "formhistory.sqlite"); 
      RemoveSpywareFile(FireFoxPath + "search.sqlite"); 
      RemoveSpywareFile(FireFoxPath + "signons.sqlite"); 
      RemoveSpywareFile(FireFoxPath + "search.json"); 
      RemoveSpywareFile(FireFoxPath + "permissions.sqlite"); 
     } 

     public static void RunCleanup() 
     { 
      try { KillProcess("iexplore"); } 
      catch { }//Need to stop incase they have locked the files we want to delete 
      try { KillProcess("FireFox"); } 
      catch { }//Need to stop incase they have locked the files we want to delete 
      string RootPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal).ToLower().Replace("documents", ""); 
      RemoveSpywareFiles(RootPath, @"AppData\Roaming\Macromedia\Flash Player\#SharedObjects",false); 
      RemoveSpywareFiles(RootPath, @"AppData\Roaming\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\#local", false); 
      RemoveSpywareFiles(RootPath, @"AppData\Local\Temporary Internet Files", false);//Not working 
      RemoveSpywareFiles("", Environment.GetFolderPath(Environment.SpecialFolder.Cookies), true); 
      RemoveSpywareFiles("", Environment.GetFolderPath(Environment.SpecialFolder.InternetCache), true); 
      RemoveSpywareFiles("", Environment.GetFolderPath(Environment.SpecialFolder.History), true); 
      RemoveSpywareFiles(RootPath, @"AppData\Local\Microsoft\Windows\Wer", true); 
      RemoveSpywareFiles(RootPath, @"AppData\Local\Microsoft\Windows\Caches", false);   
      RemoveSpywareFiles(RootPath, @"AppData\Local\Microsoft\WebsiteCache", false); 
      RemoveSpywareFiles(RootPath, @"AppData\Local\Temp", false); 
      RemoveSpywareFiles(RootPath, @"AppData\LocalLow\Microsoft\CryptnetUrlCache", false); 
      RemoveSpywareFiles(RootPath, @"AppData\LocalLow\Apple Computer\QuickTime\downloads", false); 
      RemoveSpywareFiles(RootPath, @"AppData\Local\Mozilla\Firefox\Profiles", false); 
      RemoveSpywareFiles(RootPath, @"AppData\Roaming\Microsoft\Office\Recent", false); 
      RemoveSpywareFiles(RootPath, @"AppData\Roaming\Adobe\Flash Player\AssetCache", false); 
      if (Directory.Exists(RootPath + @"\AppData\Roaming\Mozilla\Firefox\Profiles")) 
      { 
       string FireFoxPath = RootPath + @"AppData\Roaming\Mozilla\Firefox\Profiles\"; 
       DeleteFireFoxFiles(FireFoxPath); 
       foreach (string SubPath in Directory.GetDirectories(FireFoxPath)) 
       { 
        DeleteFireFoxFiles(SubPath + "\\"); 
       } 
      } 
     } 

     private static void KillProcess(string ProcessName) 
     {//We ned to kill Internet explorer and Firefox to stop them locking files 
      ProcessName = ProcessName.ToLower(); 
      foreach (Process P in Process.GetProcesses()) 
      { 
       if (P.ProcessName.ToLower().StartsWith(ProcessName)) 
        P.Kill(); 
      } 
     } 
    } 
} 
0

我會給你一個這個.. 這是我用我自己。

我召喚出一個提示框,編輯它,你想

@echo off 
echo. 
echo Clearing History 
echo Please close this window if opening this was a mistake. 
pause 
echo. 
echo Clearing History: File Explorer 
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\* 
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations\* 
Del /F /Q %APPDATA%\Microsoft\Windows\Recent\CustomDestinations\* 
REG Delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /VA /F 
REG Delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths /VA /F 
echo. 
echo Completed! 
echo. 
echo ----------------------------------------------------------------------------------- 
echo. 
echo Clearing History: Firefox 
echo. 
echo Scanning for 'Firefox' data 
set DataDir=C:\Users\%USERNAME%\AppData\Local\Mozilla\Firefox\Profiles 
IF NOT EXIST "%DataDir%" GOTO NOFIREFOXDIR 
del /q /s /f "%DataDir%" 
rd /s /q "%DataDir%" 
for /d %%x in (C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles\*) do del /q /s /f %%x\*sqlite 
GOTO YESFIREFOXDIR 
:NOFIREFOXDIR 
echo. 
echo Firefox NOT found! 
echo. 
GOTO CHROMESETUP 
:YESFIREFOXDIR 
echo. 
echo Completed! 
echo. 
:CHROMESETUP 
echo ----------------------------------------------------------------------------------- 
echo. 
echo Clearing History: Google Chrome 
echo. 
echo Scanning for 'Google Chrome' data. 
set ChromeDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data 
IF NOT EXIST "%ChromeDir%" GOTO NOCHROMEDIR 
del /q /s /f "%ChromeDir%" 
rd /s /q "%ChromeDir%" 
GOTO YESCHROMEDIR 
:NOCHROMEDIR 
echo. 
echo Google Chrome NOT found! 
echo. 
GOTO OPERASETUP 
:YESCHROMEDIR 
echo. 
echo Completed! 
echo. 
:OPERASETUP 
echo ----------------------------------------------------------------------------------- 
echo. 
echo Clearing History: Opera 
echo. 
echo Scanning for 'Opera' data. 
set OperaDir=C:\Users\%USERNAME%\AppData\Local\Opera\Opera 
set OperaDir2=C:\Users\%USERNAME%\AppData\Roaming\Opera\Opera 
IF NOT EXIST "%OperaDir%" GOTO OPERA2 
del /q /s /f "%Opera%" 
rd /s /q "%Opera%" 
:OPERA2 
IF NOT EXIST "%OperaDir2%" GOTO NOOPERADIR 
del /q /s /f "%Opera2%" 
rd /s /q "%Opera2%" 
GOTO YESOPERADIR 
:NOOPERADIR 
echo. 
echo Opera NOT found! 
echo. 
GOTO APPLESETUP 
:YESOPERADIR 
echo. 
echo Completed! 
echo. 
:APPLESETUP 
echo ----------------------------------------------------------------------------------- 
echo. 
echo Clearing History: Apple Safari 
echo. 
echo Scanning for 'Apple Safari' data. 
set AppleDir=C:\Users\%USERNAME%\AppData\Local\Applec~1\Safari 
set AppleDir2=C:\Users\%USERNAME%\AppData\Roaming\Applec~1\Safari 
IF NOT EXIST "%AppleDir%" GOTO APPLESETOP 
del /q /s /f "%AppleDir%\History" 
rd /s /q "%AppleDir%\History" 
del /q /s /f "%AppleDir%\Cache.db" 
del /q /s /f "%AppleDir%\WebpageIcons.db" 
:APPLESETOP 
IF NOT EXIST "%AppleDir2%" GOTO NOAPPLEDIR 
del /q /s /f "%AppleDir2%" 
rd /s /q "%AppleDir2%" 
GOTO YESAPPLEDIR 
:NOAPPLEDIR 
echo. 
echo Apple Safari NOT found! 
echo. 
GOTO INTESETUP 
:YESAPPLEDIR 
echo. 
echo Completed! 
echo. 
:INTESETUP 
echo ----------------------------------------------------------------------------------- 
echo. 
echo Clearing History: Microsoft Internet Explorer 
echo. 
echo Scanning for 'Microsoft Internet Explorer' data. 
set IEDataDir=C:\Users\%USERNAME%\AppData\Local\Microsoft\Intern~1 
IF NOT EXIST "%IEDataDir%" GOTO HISTORYDIR 
del /q /s /f "%IEDataDir%" 
rd /s /q "%IEDataDir%" 
:HISTORYDIR 
set History=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\History 
IF NOT EXIST "%History%" GOTO IETEMPDIR 
del /q /s /f "%History%" 
rd /s /q "%History%" 
:IETEMPDIR 
set IETemp=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\Tempor~1 
IF NOT EXIST "%History%" GOTO COOKIESDIR 
del /q /s /f "%IETemp%" 
rd /s /q "%IETemp%" 
:COOKIESDIR 
set Cookies=C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Cookies 
IF NOT EXIST "%Cookies%" GOTO FLASHCCC 
del /q /s /f "%Cookies%" 
rd /s /q "%Cookies%" 
:FLASHCCC 
set FlashCookies=C:\Users\%USERNAME%\AppData\Roaming\Macromedia\Flashp~1 
IF NOT EXIST "%FlashCookies%" GOTO FINAL 
del /q /s /f "%FlashCookies%" 
rd /s /q "%FlashCookies%" 
:FINAL 
echo. 
cls 
echo. 
echo Thank you for using our cleaner... 
echo. 
pause