In need of a script...


  1. Posts : 2,292
    Windows 7 Home Premium x64
       #1

    In need of a script...


    I am looking for a script which can delete cookies, Windows + browser cache automatically on a regular (scheduled) basis. Can this be done through Windows itself or would i have to implement a custom script or something?

    I am looking to replace CCleaner and similar software package(s). Just now I troubleshooted my sister's PC with an expert who said that stuff like Ccleaner is nothing but trouble. He removed the garbage files manually through Total Commander (ugh), but honestly I can't be bothered to barge into my sis' room every couple of days and ravage through AppData folders to remove temp data and cookies.
      My Computer


  2. Posts : 8,398
    ultimate 64 sp1
       #2

    have you tried windows disk cleanup?

    just type cleanup into the start-menu search-box.

    *edit* sorry, re-reading your post it seems you want to automate it.

    you can use task-scheduler to (wait-for-it) schedule tasks, but i don't know how to automate the cleanup options...read this tutorial - it's for an annual (!) cleanup, but can be easily modified.
      My Computer


  3. Posts : 2,292
    Windows 7 Home Premium x64
    Thread Starter
       #3

    Ah, I see now xD
    Thanks, will try it, hope it works.
    In the meantime, I'd like to hear more suggestions and/or confirmation of efficiency by using this kind of process instead of stuff like Ccleaner (and similar).
      My Computer


  4. Posts : 6,349
    Windows7 Pro 64bit SP-1; Windows XP Pro 32bit
       #4

    +1 For Windows disk Clean Up.

    It doesn't do any damage and safetly cleans out everything.

    The scheduler appears to run as Administrator so it should be thorough.

    Weekly looks good or sooner if wanted. Or on start up though it may slow start up a bit.

    My 2 pennies.
    Mike
      My Computer


  5. Posts : 6,285
    Windows 10 Pro X64
       #5

    You can schedule CCleaner to run automatically once you've set it up the way you want. Not what you asked but thought I'd throw it out here anyway. CCleaner accepts command line parameters. See here:

    Piriform - Command-line parameters

    eg:

    CCleaner.exe /AUTO CCleaner runs silently and automatically, using the current set of saved options to clean the PC. CCleaner then exits.

    CCleaner.exe /AUTO /SHUTDOWN CCleaner runs silently and automatically, using the current set of saved options to clean the PC. Windows then shuts down automatically..

    Note: You cannot run /SHUTDOWN by itself. It must be preceded by /AUTO.
      My Computer


  6. Posts : 3,139
    Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
       #6

    Mickey's solution was great. If you wanted to create a batch file ...


    DEL /S/F/Q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
    DEL /S/F/Q "%USERPROFILE%\Cookies"
    DEL /S/F/Q "%USERPROFILE%\Recent"
    DEL /S/F/Q "%USERPROFILE%\Local Settings\History"
    endif
      My Computer


  7. Posts : 2,292
    Windows 7 Home Premium x64
    Thread Starter
       #7

    Thanks, Lemur
      My Computer


  8. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #8

    Lemur said:
    Mickey's solution was great. If you wanted to create a batch file ...


    DEL /S/F/Q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
    DEL /S/F/Q "%USERPROFILE%\Cookies"
    DEL /S/F/Q "%USERPROFILE%\Recent"
    DEL /S/F/Q "%USERPROFILE%\Local Settings\History"
    endif
    Lemur, respectfully there are several problems with this script.

    1) Most of those files do not exist in those places. They are junction points to the real place the files are stored. So if you look in "%USERPROFILE%\Recent" from the Command Prompt you will see that is it empty. You really need to go to:

    "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent"

    2) Plus you don't want to delete the desktop.ini files in those folders. Not that it will destroy anything but it will remove the pretty icons and the way the folder functions when you look at them in Windows Explorer. -WS
      My Computer


  9. Posts : 2,292
    Windows 7 Home Premium x64
    Thread Starter
       #9

    Thanks for the input, WS, I set up the cleanup utility and scheduled it to run every few days, so it's good
      My Computer


  10. Posts : 3,139
    Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
       #10

    WindowsStar said:
    Lemur said:
    Mickey's solution was great. If you wanted to create a batch file ...


    DEL /S/F/Q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
    DEL /S/F/Q "%USERPROFILE%\Cookies"
    DEL /S/F/Q "%USERPROFILE%\Recent"
    DEL /S/F/Q "%USERPROFILE%\Local Settings\History"
    endif
    Lemur, respectfully there are several problems with this script.

    1) Most of those files do not exist in those places. They are junction points to the real place the files are stored. So if you look in "%USERPROFILE%\Recent" from the Command Prompt you will see that is it empty. You really need to go to:

    "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent"

    2) Plus you don't want to delete the desktop.ini files in those folders. Not that it will destroy anything but it will remove the pretty icons and the way the folder functions when you look at them in Windows Explorer. -WS
    YIKES! My bad. Old script. Sorry
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:44.
Find Us