1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

BAT file to delete cache in win2K

Discussion in 'Legacy Windows' started by TonyT, 2003/03/19.

Thread Status:
Not open for further replies.
  1. 2003/03/19
    TonyT

    TonyT SuperGeek Staff Thread Starter

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    How would I use these lines in a bat file that I could run in safe mode w/ command prompt to delete the specified directories? In win98 it was easy to do just by restarting in full dos and deleting the directories, but win2k is a bit different. A bat file would speed it up considerably. These are the needed lines, but how do I make a bat file using them? (I know that I can use Notepad and save as xxx.bat, but what other lines are needed?)

    RD /S "D:\Documents and Settings\Adminstrator\Local Settings\Temporary Internet Files "
    RD /S "D:\Documents and Settings\Administrator\Local Settings\HISTORY "
    RD /S "D:\Documents and Settings\Administrator\Local Settings\COOKIES "
     
    Last edited: 2003/03/19
  2. 2003/03/22
    Ludwig

    Ludwig Well-Known Member

    Joined:
    2002/01/07
    Messages:
    146
    Likes Received:
    0
    BAT file options

    Give this a try ...

    Paste your lines into a CLEANUP.BAT file (in your "My Documents "?) then add a shortcut to it in your (Administrator) start menu startup folder. That way it'll be executed each time you log on.

    For simplicity, just start it with an "echo off" line, although it is optional. i.e.

    @echo off
    RD /S "D:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files "
    RD /S "D:\Documents and Settings\Administrator\Local Settings\HISTORY "
    RD /S "D:\Documents and Settings\Administrator\Local Settings\COOKIES "

    Then check it works ok. When you're happy with it, edit the properties of the shortcut and select Run as "minimised" if you get annoyed at seeing the window everytime.


    You could also generalise it a little more and use it on all users when they logon.
    Replace the "D:\Documents and Settings\Administrator" text string with %USERPROFILE% ... e.g.

    RD /S "%USERPROFILE%\Local Settings\Temporary Internet Files "

    The environment variable USERPROFILE contains the location of the userid's "docs & settings" area. Suggest you open a DOS prompt and check that it's value is what you're expecting (mine points to C: drive) - do that by typing SET and loking for it or typing echo .%USERPROFILE%.

    If you do it this way, and check it works ok (always a good move ;-} ) transfer the BAT file to a location all your IDs have READ access to, and move the shortcut to the "All Users" Start menu STARTUP folder. Then all userids will have these actions taken as they logon - whether they're created now or in the future. You could also opt to mark the BAT & shortcut files READ-ONLY for further added removal protection.
     

  3. to hide this advert.

  4. 2003/03/26
    TonyT

    TonyT SuperGeek Staff Thread Starter

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Thanks much. I was uncertain re the @echo off. Also, take notice, I had the incorrect path to Cookies, should be:
    RD /S "D:\Documents and Settings\Administrator\COOKIES "

    Rather than having this run at startup, I use it manually like this:

    1. execute the bat file by double ckicling it and closing the folder it resides in.
    2. use task manager to end the process Explorer.EXE
    3. proceed to delete the items specified in the bat file via the prompts in the command window.
    4. when it finishes, the command window closes automatically an dI return to task manager's File Menu and run a new task 'Explorer.EXE'.

    voila!
     
  5. 2003/03/29
    drdancm

    drdancm Inactive

    Joined:
    2002/02/03
    Messages:
    44
    Likes Received:
    0
    Try Tweak UI v 1.3

    You can find Tweak UI 1.33 by doing an internet search.

    This great unofficial free util was written by but is not supported by MSoft.

    Under the Paranoia Tab you will find checkbox options for clearing out a whole bunch of history files. It may very well do everything you want and then some.

    This utility which works on Win200 is also great for doing a lot of other good stuff.

    A real GEM of a program.

    PS after self expansion, right click on the
    ini file and choose install - the Tweak icon will then appear in the Control Panel

    Dan
     
  6. 2003/03/29
    TonyT

    TonyT SuperGeek Staff Thread Starter

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    tweakui does not delete the entire folders and the index.dat files.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.