Computing.Net > Forums > Windows NT > how to clean the temp directory

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to clean the temp directory

Reply to Message Icon

Name: Mink Visser
Date: July 13, 1999 at 02:02:00 Pacific
Comment:

I want to make a batch-file wich delete everything in the temp directory including subdirectory's when you start your computer

I've tried -> rd c:\temp /s /q
md temp

but it doesn't work for other users because they have no rights in the root, only in the temp directory.
I hope somebody has got an answer.



Sponsored Link
Ads by Google

Response Number 1
Name: Anthony Brown
Date: July 13, 1999 at 06:56:14 Pacific
Reply:

You could try del c:\temp\*.* /s /q


0

Response Number 2
Name: Dean
Date: August 11, 1999 at 08:38:08 Pacific
Reply:

echo Y | del c:\temp\*.*

will delete the files without prompting you...

Note: This will not remove files in subs...
if you know what the dir names will always be you could just add them to the .bat file and do the same as above....


If you were running 95/98 (Not in NT)
You could do

deltree c:\temp
mkdir c:\temp

which would accomplish the end result...
Empty directory :)

Good Luck!


0

Response Number 3
Name: Mike Barrett
Date: December 29, 2000 at 10:54:52 Pacific
Reply:

To clean out the Windows™ Temp directory put the following line in your autoexec.bat:

deltree /y c:\windows\temp\ >nul

This will delete all files and subdirectories within the temp directory yet leave the temp directory. This will also send the output to the NUL device rather than to the display.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows NT Forum Home


Sponsored links

Ads by Google


Results for: how to clean the temp directory

How to change the Default I386 directory? www.computing.net/answers/windows-nt/how-to-change-the-default-i386-directory/10506.html

how to change the default directory for. www.computing.net/answers/windows-nt/how-to-change-the-default-directory-for/19080.html

*.cct folders in the Temp directory in NT 4.0 www.computing.net/answers/windows-nt/cct-folders-in-the-temp-directory-in-nt-40/8718.html