使用脚本清除的Internet Explorer 6.0浏览历史记录 [英] Clear Internet Explorer 6.0 browsing history using Script
本文介绍了使用脚本清除的Internet Explorer 6.0浏览历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用下面的脚本删除浏览历史记录中的IE 7.0
RUNDLL32.EXE InetCpl.cpl,ClearMyTracksByProcess 255
但现在我需要一个脚本来清除IE 6.0浏览历史记录
我得到一个错误失踪入门ClearMyTracksByProcess我已经通过不同的参数,如2,5等,并没有成功。
解决方案
// TEST.CPP:定义控制台应用程序的入口点。
//的#includestdafx.h中
#包括test.h
#包括LT&;&shlguid.h GT; //为所需CLSID_CUrlHistory
#包括LT&;&urlhist.h GT; //为所需和IUrlHistoryStg2 IID_IUrlHistoryStg2#IFDEF _DEBUG
新的#define DEBUG_NEW
#万一
//唯一的一个应用程序对象CWinApp的app的;使用命名空间std;INT _tmain(INT ARGC,TCHAR *的argv [],TCHAR * envp [])
{
INT NRET code = 0; //初始化MFC和失败打印和错误
如果(!AfxWinInit(::的GetModuleHandle(NULL),NULL,:: GetCommandLine(),0))
{
// TODO:更改错误code,以满足您的需求
_tprintf(_T(致命错误:MFC初始化失败\\ n));
NRET code = 1;
}
其他
{
// TODO:code在这里你的应用程序的行为。 IUrlHistoryStg2 * pHistory; //我们需要这个接口用于清除历史记录。
HRESULT小时;
DWORD CREF;
CoInitialize的(NULL);
//加载正确的类别,并要求IUrlHistoryStg2
HR = CoCreateInstance的(CLSID_CUrlHistory,NULL,CLSCTX_INPROC_SERVER,
IID_IUrlHistoryStg2,reinter pret_cast<无效**指(安培; pHistory)); 如果(成功(HR))
{
//清除IE历史记录
HR = pHistory-> ClearHistory();
}
//释放我们参考
CREF = pHistory->发行();
CoUninitialize();
} 返回NRET code;
}
I was using the following script to delete the browsing history in IE 7.0
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
But now I need a script to clear browsing history in IE 6.0
I get an error that "missing entry ClearMyTracksByProcess" I have passed different parameters like 2 ,5 etc and wasn't successful.
解决方案
// 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;
}
这篇关于使用脚本清除的Internet Explorer 6.0浏览历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文