msb5150 Posted February 28, 2004 Share Posted February 28, 2004 I am writing a small program the runs when ever i click on an internet explorer icon, and waits for all instances of ie(IEXPLORE.EXE) to stop, at which time it should delete all items in the history folder, cookies folder, and temporary internet files folder, however, I cannot seem to get it to delete the files within these folders. I have tried to use the exact folder names for my account, using the CLSID codes for them, and even using the windows code, if that's what its called. Examples of what I have tried are below.;AutoItSetOption("TrayIconHide", 1) $PName = "ClearIE" If WinExists($PName) Then Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE", "C:\Program Files\Internet Explorer", @SW_MAXIMIZE) Exit EndIf AutoItWinSetTitle($PName) Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE", "C:\Program Files\Internet Explorer", @SW_MAXIMIZE) ProcessWaitClose("IEXPLORE.EXE") ;First attempt FileDelete("C:\Documents and Settings\USERNAME\Local Settings\History\*.*") FileDelete("C:\Documents and Settings\USERNAME\Cookies\*.*") FileDelete("C:\Documents and Settings\USERNAME\Temporary Internet Files\*.*") ;Second attempt FileDelete("::{FF393560-C2A7-11CF-BFF4-444553540000}\*.*");History Folder FileDelete("::{7BD29E00-76C1-11CF-9DD0-00A0C9034933}\*.*");Temporary Internet Files Folder FileDelete("::{BDEADF00-C265-11d0-BCED-00A0C90AB50F}\*.*");Web Folders ;Third attempt FileDelete("%USERPROFILE%\Local Settings\History\*.*") FileDelete("%USERPROFILE%\Cookies\*.*") FileDelete("%USERPROFILE%\Local Settings\Temporary Internet Files\*.*") TrayTip("ClearIE", "IE history, cookies, and temporary internet files have been cleared.", 3, 17) Sleep(7000) Link to comment Share on other sites More sharing options...
Developers Jos Posted February 28, 2004 Developers Share Posted February 28, 2004 You have put some V2 coding in this example. Maybe you could try one of these ? ;First attempt FileDelete("C:\Documents and Settings\" & @USERNAME & "\Local Settings\History\*.*") ;Third attempt FileDelete(GetEnv("USERPROFILE") & "\Local Settings\History\*.*") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valik Posted February 28, 2004 Share Posted February 28, 2004 In IE6, there is an option to delete temporary internet files on close. You can probably set that flag through the registry if you use IE 6 (May be IE6 SP-1...). Also, I don't think you'll have much luck deleting the temporary internet files without iterating through every single file, I think index.dat is always locked so FileDelete will fail. The history should be easy to delete, though. You can use JdeB's method, except instead of EnvGet("USERPROFILE") you can just the @UserProfile macro. Link to comment Share on other sites More sharing options...
msb5150 Posted February 28, 2004 Author Share Posted February 28, 2004 Thank you both, I had wondered about index.dat, and discovered its protected status only recently, I will look for that registry entry, as it will be helpful, and hopeully with the revised history deletion, that will work too. The one problem that I solved myself was that of the Cookies folder, for that(which has a protected index.dat) i chose to delete all .txt files, as there are no cookies to my knowelege that are not .txt files. Link to comment Share on other sites More sharing options...
msb5150 Posted February 29, 2004 Author Share Posted February 29, 2004 I have tried the methods suggested for deleting the history with no success, is there some alternative method I might try? The only other thing I could think of was to right a batch file and see if that does the trick. Also, to let others know, the registry tweak to force IE to delete temporary files on close does not work as shown in the few Windows tweaking sites I have found: Instead of deleting the temporary files, Windows instead places them in several folders, however, the files themselves are very much intact. To reiterate, I am asking for any method to remove the IE history throught Autoit (aside from actually opening up the IE menu and choosing to clear the history) Thank you. Link to comment Share on other sites More sharing options...
Valik Posted February 29, 2004 Share Posted February 29, 2004 If you want to use only AutoIt (No batch or DOS commands) then it will probably be a nightmare to code. You'll need to recursively delete each individual file using FileDelete (Find them through FileFindFirstFile and FileFindNextFile). You might also want to sprinkle a DirRemove onto each directory and hope it will remove the directory to save some time. Jon has written a recursive delete similar to this, you might give that function a try first. But it'll probably be slow the first time because their will probably be thousands of items to delete.... Link to comment Share on other sites More sharing options...
CyberSlug Posted February 29, 2004 Share Posted February 29, 2004 Might not help, but look at alternate browsers like Mozilla Firefox.Numerous extensions are available. One called 'X' "adds a toolbar button from which you can quickly clear privacy sensitive data, specifically: history, form info, saved passwords, download history, cookies, and the cache (both disk and in memory cache)." Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
msb5150 Posted February 29, 2004 Author Share Posted February 29, 2004 thanks for all y'alls help, im nearly finished with it(i just need to find the way to clear the typed url history, as I have found it to be in multiple places in the registry. To solve the history, and temporary internet files problem, i wrote a batch file, and a windows script file which hides the batch file execution(both of which I based of code i found online) which i call from the script, works well. Link to comment Share on other sites More sharing options...
Neoborn Posted March 17, 2006 Share Posted March 17, 2006 thanks for all y'alls help, im nearly finished with it(i just need to find the way to clear the typed url history, as I have found it to be in multiple places in the registry. To solve the history, and temporary internet files problem, i wrote a batch file, and a windows script file which hides the batch file execution(both of which I based of code i found online) which i call from the script, works well.Can you send me your end result? ~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT Link to comment Share on other sites More sharing options...
seandisanti Posted March 17, 2006 Share Posted March 17, 2006 Can you send me your end result?not sure if you incorporated it in yours, but when i made one of this type of script, i also wanted to get rid of the typed urls (the ones that show under the address bar when you expand it out)the typed urls are listed atHKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLsin the registry of course. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now