DoctorX Posted August 30, 2005 Share Posted August 30, 2005 (edited) Here's a little pgm to clear your internet history, cookies, temporary internet files, and recent documents list. It's basically something I put together to test the WinShield function I wrote for another program, but kinda handy anyway. Please note: This will only work if you are using the "classic start menu". Also, the WinShield function will temporarily disable the keyboard and mouse. Press Ctrl+Alt+Delete if input is not restored. Edit: Made a slight change to the code due to something wOuter pointed out. Also- there are other ways to do this (see below). I probably should have posted this under the heading of "Demonstration of the WinShield function", but anyway... expandcollapse popup;============================================================================== ; ; ; Cleanse ; ; ; Version 2.5 ; August 31, 2005 ; Created by David C. Reynolds ; Compiled with AutoIT 3.1 ; ; - Clears the internet history , temporary files, and cookies ; ; - Clears recent documents list ; ; - For Windows XP Home Edition with Classic Start Menu ; ; ;============================================================================== ;############################################################################## ; ; ; MAIN PROGRAM ; ; ; Revision 2 ; Last Edited August 29, 2005 for Cleanse 2.4 ; Written by David C. Reynolds ; ; - Program instructions for Cleanse 2.4 ; ; - Dependent Functions: ; ActWin ; WinShield ; ; ;############################################################################## ;------------------------------------------------------------------------------ ; GLOBAL SETTINGS AND INCLUDE FILES- #include <GUIConstants.au3> ;------------------------------------------------------------------------------ ; PUT UP WINSHIELD- WinShield ("Cleansing") ;------------------------------------------------------------------------------ ; CLEAR INTERNET FILES- ; Open the Control Panel: Run ("Control Panel") ActWin ("Control Panel", "") ; Open the Internet Properties dialogue box: Send ("i") Send ("{ENTER}") ActWin ("Internet Properties", "") ; Delete Cookies: Send ("{TAB}") Send ("i") ActWin ("Delete Cookies", "") Send ("{ENTER}") WinWaitClose ("Delete Cookies") ; Delete Temporary Internet Files: Send ("f") ActWin ("Delete Files", "") Send ("{ENTER}") WinWaitClose ("Delete Files") ; Clear History: Send ("h") ActWin ("Internet Options", "") Send ("Y") WinWaitClose ("Internet Options") ; Close the Internet Properties dialogue box: ControlClick ("Internet Properties", "General", 1) WinWaitClose ("Internet Properties") ;------------------------------------------------------------------------------ ; CLEAR RECENT DOCUMENTS LIST- ; Open the Taskbar and Start Menu dialogue box: Send ("t") Send ("{ENTER}") ActWin ("Taskbar and Start Menu Properties", "Taskbar") ; Switch to Start Menu and clear Recent Documents: Send ("^{TAB}") ActWin ("Taskbar and Start Menu Properties", "Start Menu") Send ("c") ActWin ("Customize Classic Start Menu", "") Send ("c") ; Close Taskbar menus: WinClose ("Customize Classic Start Menu") WinWaitClose ("Customize Classic Start Menu") Winclose ("Taskbar and Start Menu Properties") WinWaitClose ("Taskbar and Start Menu Properties") ; Close Control Panel: WinClose ("Control Panel") WinWaitClose ("Control Panel") ;------------------------------------------------------------------------------ ; REMOVE THE WINSHIELD- WinShieldOff ("Cleansing") ;############################################################################## ; ; ; ActWin Function ; ; ; Revision 1 ; Last Edited August 29, 2005 for Cleanse 2.4 ; Written by David C. Reynolds ; ; - Waits for a window to open, then activates it for input ; ; - Dependent Functions: ; none ; ; - Input Variables: ; $title The title of the window ; $text The visible text of the window ; ; ; - Output Returns: ; "1" if successful ; ; ;############################################################################## ;------------------------------------------------------------------------------ ; BEGIN ACTWIN FUNCTION- Func ActWin ($title, $text) ;------------------------------------------------------------------------------ ; DELCARE LOCAL VARIABLES- ; Title of the window: Local $title ; Visible text in the window: Local $text ;------------------------------------------------------------------------------ ; WINDOW VERIFICATION AND ACTIVATION- ; Wait for the window, activate it, and wait for it to become active: WinWait ($title, $text) WinActivate ($title, $text) WinWaitActive ($title, $text) ;------------------------------------------------------------------------------ ; END ACTWIN FUNCTION- Return 1 EndFunc ;############################################################################## ; ; ; WinShield Function ; ; ; Revision 2 ; Last Edited August 27, 2005 for Falcon 4 Dance Partner 1.1 ; Written by David C. Reynolds ; ; - Creates a transparent window (Windows 2000 or later) and blocks user input ; while script is running ; ; - Dependent Functions: ; <GUIConstants.au3> ; ; - Input Variables: ; $title Title of the WinShield window ; ; - Output Returns: ; "1" if successful ; ; ;############################################################################## ;------------------------------------------------------------------------------ ; BEGIN WINSHIELD FUNCTION- Func WinShield ($title) ;------------------------------------------------------------------------------ ; DECLARE LOCAL VARIABLES- ; Title of the window: Local $title ;------------------------------------------------------------------------------ ; CREATE WINSHIELD- ; Create full-screen transparent window: GUICreate ($title, @DesktopWidth, @DesktopHeight) WinSetTrans ($title, "", 210) WinSetOnTop ($title, "", 1) ; Create label: GUICtrlCreateLabel ("Performing the requested action. Do not disturb _ the keyboard or mouse during this time.", 0, _ (@DesktopHeight / 2), @DesktopWidth, @DesktopHeight) GUICtrlSetFont (-1, 16, 600) GUICtrlSetStyle (-1, $SS_CENTER) ; Create help label: GUICtrlCreateLabel ("In case of emergency, press Ctrl+Alt+Delete to _ restore mouse and keyboard control.", 0, _ (@DesktopHeight - 100), @DesktopWidth) GUICtrlSetStyle (-1, $SS_CENTER) ; Show the window: GUISetState (@SW_SHOW) ; Disable mouse and keyboard and set wait cursor: BlockInput (1) GUISetCursor (15) ;------------------------------------------------------------------------------ ; END WINSHIELD FUNCTION- Return 1 EndFunc ;############################################################################## ; ; ; WinShieldOff Function ; ; ; Revision 1 ; Last Edited August 31, 2005 for Cleanse 2.5 ; Written by David C. Reynolds ; ; - Removes the screen set by WinShield and restores user input ; ; - Dependent Functions: ; <GUIConstants.au3> ; ; - Input Variables: ; $title Title of the WinShield window ; ; - Output Returns: ; "1" if successful ; ; ;############################################################################## ;------------------------------------------------------------------------------ ; BEGIN WINSHIELDOFF FUNCTION- Func WinShieldOff ($title) ;------------------------------------------------------------------------------ ; DECLARE LOCAL VARIABLES- ; Title of the window: Local $title ;------------------------------------------------------------------------------ ; REMOVE WINSHIELD- ; Restore mouse and keyboard control: BlockInput (0) ; Delete the GUI window: GUIDelete () ;------------------------------------------------------------------------------ ; END WINSHIELDOFF FUNCTION- Return 1 EndFunc Edited August 31, 2005 by DoctorX -DRX Link to comment Share on other sites More sharing options...
Raindancer Posted August 30, 2005 Share Posted August 30, 2005 Why do you create a Winshield, when BlockInput(1/0) would do the same but without a transparent fulscreen gui on it. Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer Link to comment Share on other sites More sharing options...
DoctorX Posted August 30, 2005 Author Share Posted August 30, 2005 The program that I wrote the WinShield function for is intended to be released to the public. It's basicaly there to keep the end user from thinking his/her system locked up while the program is installing other programs. -DRX Link to comment Share on other sites More sharing options...
Raindancer Posted August 30, 2005 Share Posted August 30, 2005 OK. Overlooked the labels. Good idea then Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer Link to comment Share on other sites More sharing options...
w0uter Posted August 30, 2005 Share Posted August 30, 2005 (edited) refrain from using the keyboard/mouse. and you wouldnt need them to stop using it. also: AFAIK your guicreate/delete func doesnt work like it should. Edited August 30, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Gigglestick Posted August 30, 2005 Share Posted August 30, 2005 There are DllCall's you can use to clear the cache, history, cookies, etc., but I can't remember off-hand what they are. Google it. My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
DoctorX Posted August 30, 2005 Author Share Posted August 30, 2005 Good idea then <{POST_SNAPBACK}>Thanx, man.There are DllCall's you can use to clear the cache, history, cookies, etc., <{POST_SNAPBACK}>You're probably right, but I intentionally wanted to write a program that would act as a virtual user to test the WinShield func.AFAIK your guicreate/delete func doesnt work like it should.<{POST_SNAPBACK}>Could you elaborate? Been working fine for me. -DRX Link to comment Share on other sites More sharing options...
w0uter Posted August 30, 2005 Share Posted August 30, 2005 the gui doesnt delete becouse you dont give it the correct parameter ( you need the RETURN value from GuiCreate not the title ) ( OR you could just do GuiDelete() ) the way it is now the exit closes the GUI My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
DoctorX Posted August 31, 2005 Author Share Posted August 31, 2005 Ohhhhh..... I'm glad you caught that. I've got me some changin' to do.... Thanx, wOuter. -DRX Link to comment Share on other sites More sharing options...
Valuater Posted August 31, 2005 Share Posted August 31, 2005 (edited) might want to take a look at this Run('control inetcpl.cpl') WinWait('Internet Properties') ControlClick('Internet Properties', '', 'Button6') WinWait('Delete Cookies') ControlClick('Delete Cookies', '', 'Button1') If Not WinWaitActive('Internet Properties') Then WinActivate('Internet Properties') ControlClick('Internet Properties', '', 'Button7') WinWait('Delete Files') ControlClick('Delete Files', '', 'Button2') If Not WinWaitActive('Internet Properties') Then WinActivate('Internet Properties') ControlClick('Internet Properties', '', 'Button10') WinWait('Internet Options') ControlClick('Internet Options', '', 'Button1') WinWait('Internet Properties') ControlClick('Internet Properties', '', 'Button15') its a little cleaner approach Enjoy! 8) Even better...check out *XPClean Menu* below Edited August 31, 2005 by Valuater 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