Вы находитесь на странице: 1из 2

Delete IE7 History from the Command Line

Sometimes it is much easier to simply run a command line command or batch file to perform the
same tasks. I use such a batch file and place it in one of my "special scripts" folder, where I store
all my cool stuff. All I have to do is simply double-click on it, and bingo, history, passwords,
cookies and offline files are deleted.

Here are the independent commands you can use. Go to Start > Run. Type CMD and press
Enter. In the Command Prompt window, type (or copy and paste) the following commands,
and press Enter:

Delete Temporary Internet Files

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

Delete Cookies

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

Delete History

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

Delete Form Data

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

Delete Stored Passwords

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Delete All

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

Delete All with the "Also delete files and settings stored by add-ons" options selected

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Now it seems that the interesting bit is that you can combine the numbers to get 2 or more
functions at the same time. For example, type:

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 9

This will delete the files (+8) and history (+1) in one step. You can incorporate this into a logoff
script, and assign it to users by using Group Policy (GPO).
Creating a batch file
You can also create a batch file that you can simply run by double-clicking on it or running as a
logoff script. Save the following text as a .BAT file:

@ECHO OFF
ECHO Deleting current user's Temporary Files, Cookies, History, Form Data and
Stored Passwords
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
ECHO Done!
PAUSE
CLS

Second example uses e different approach, but it's also worth noting:

@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

Вам также может понравиться