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.

batch files

Discussion in 'Legacy Windows' started by baddawg621, 2003/06/25.

Thread Status:
Not open for further replies.
  1. 2003/06/25
    baddawg621

    baddawg621 Inactive Thread Starter

    Joined:
    2003/05/14
    Messages:
    19
    Likes Received:
    0
    Hiyas,

    I am trying to automate clean up procedures our night crew performs and am needing some assistance. Below is an example:
    ( I left out the extra junk that identifies the machine name, echo, its all there though, just the basics here)

    cd C:\Documents and Settings\%USERNAME%\Cookies\
    del *.*
    cd C:\Documents and Settings\%USERNAME%\Local Settings\Temp
    del *.*
    cd C:\Documents and Settings\%USERNAME%\Local Settings\ "Temporary Internet Files "
    del *.*
    PAUSE

    (pause for my purpose of testing to catch any errors)

    Cookies and temp files are deleted fine, the Temp Internet files are not removed at all.

    Another question, is there a way to delete the History through the batch file as well?

    Any suggestions would be greatly appreciated. This is making me nuts...still a rookie batch file maker.
     
  2. 2003/06/26
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    This is my 'cleanup.bat'

    @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\COOKIES "

    Execute this bat file, then use Task Manager to end task on Explorer.exe. Then use the bat file prompts 'y' & 'enter key'.

    Bat file will close when done, then use task manager to run a new task 'Explorer.exe'.
     

  3. to hide this advert.

  4. 2003/06/26
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    TonyT - I just tried that very interesting procedure. Hadn't realized you could close the desktop by killing explorer.exe and have the system remain then start it again. Nice.

    But for some reason I don't think the batch file was working right for me. Got "device not ready" errors with each RD line. I was doing it on XP-pro so maybe different behavior than with 2K?
     
    Newt,
    #3
  5. 2003/06/26
    baddawg621

    baddawg621 Inactive Thread Starter

    Joined:
    2003/05/14
    Messages:
    19
    Likes Received:
    0
    wOOhOO ! Thanks Alot ! It worked wonderfully. I appreciate the assistance greatly!

    Regards.
     
  6. 2003/06/26
    markp62

    markp62 Geek Member Alumni

    Joined:
    2002/05/01
    Messages:
    4,012
    Likes Received:
    16
    That little trick will also work with 98SE, but Explorer.Exe immediately reloads. More like a quick reboot with 98, but not all startup programs play nicely with this.
     
  7. 2003/06/26
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Did you have any other apps opened? That should work in xppro, but not sure, I don't have xp.

    You can also logon as a different user w/ admin rights and delete the folders, then log back on as admin.
     
  8. 2003/06/27
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    TonyT - I know I can do the stuff in several ways. Just interested in your .bat file.

    And yup - had other stuff open.
     
    Newt,
    #7
  9. 2003/06/27
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Does it now work when all other apps closed? (good to know for future reference to xp users)
     
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.