1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Deleting contents of WINDOWS\TEMP folder

Discussion in 'Earlier Versions of Windows' started by DonW, Dec 4, 2001.

Thread Status:
Not open for further replies.
Advertisement
  1. DonW

    DonW Thread Starter

    Joined:
    Aug 18, 2000
    Messages:
    94
    In my autoexec.bat I placed the statement:

    @IF EXIST C:\WINDOWS\TEMP\*.* DEL C:\WINDOWS\TEMP\*.*

    I did this for obvious reasons....to empty my TEMP folder on bootup. My question is this:
    I assumed that if the folder had any contents that they would be deleted automatically without being prompted. However, that doesn't happen. I continually get prompted for confirmation when there are files in that folder. Does anyone know of a way to eliminate the promping? The DEL and ERASE commands don't offer a switch that bypasses prompting. What's strange tho is the fact that there IS a switch to force the command to prompt you first before deleting the files....which is kind of redundant since it prompts me anyway even without the switch. This post should probably be in the DOS forum so I apologize. I am running Win98SE and would like to use a simple DOS command at bootup to empty my WINDOWS\TEMP folder.

    Any ideas?
     
  2. angel

    angel

    Joined:
    Dec 2, 1998
    Messages:
    2,736
    Use deltree with the /y switch.
     
  3. TonyKlein

    TonyKlein Malware Specialist

    Joined:
    Aug 26, 2001
    Messages:
    10,392
    You ought to include 'smartdrv' as well:

    @ECHO OFF
    smartdrv
    DELTREE /Y C:\WINDOWS\TEMP\*.* > NUL


    But I don't advise it, as you'll have problems installing certain programs.

    Some programs put stuff in your temp folder, that they need after reboot to complete the installation.

    You can delete your temporary internet files, history, cookies, everything you like at startup, but don't do your temp folder.

    Make a little batch file with these lines in it, and activate it through a desktop shortcut.
    Add CLS as a last line, so that the DOS window will close after running the batch file.

    Good luck,
     
  4. jbcalg

    jbcalg

    Joined:
    Oct 29, 2001
    Messages:
    2,056
    i use a bat file written by fred langa and distributed in his newsletter, you can run it from an icon, in your autoexec, etc

    very fast, also very aggressive, but you can modify it to suit your needs

    fred has an excellent, and free!, newsletter twice a week on a variety of computer topics

    here's the LangaList link for the CleanAll.bat file
     
  5. Nix

    Nix

    Joined:
    Dec 2, 2001
    Messages:
    102
    I thought the CLS command in DOS CLears Screen providing you with a prompt on a clear screen ?
     
  6. Emtronics

    Emtronics

    Joined:
    Jan 20, 2000
    Messages:
    2,984
    The CleanAll.bat from the Langa list is an excellent way to clear your temp folder and you can also add it to the RIGHT click menu of the Recycle Bin. Just RIGHT click the Recycle Bin and the CleanAll.bat is a choice. You can find this also at jbcalg's link posted above for the Langalist.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/60657

  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.
    Dismiss Notice