Discussion Locked

Deleting Temp File Automatic

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello NT expert,
is there anybody know how to automatically delete temp file on Windows NT 4.0.
Thanks..

9 replies

by tore

Hi!

You should write a batchfile and use the command at to schedule it to run when you need it to. If you put it in the startupfolder, it will only run once (when you log on to your server. The at command runs at specific (you decide) times! Justtype at /? for syntax in an cmd window. Hope this helps!

by mahdeekus

Just in case you need something more specific (without wanting to be too patronising):

You can create a batch file containing the following text:

REM Delete Temp Files
cd c:\temp
del *.*
cd c:\winnt\temp
del *.*
exit

Type all of this text into Notepad. Save this file with a .bat file extension to
c:\Winnt\Profiles\All Users\Start Menu\Programs\Startup

if C: is your drive that contains Windows NT. This will only work if you are logged on as administrator or as someone with local administrator rights to the NT 4.0 machine.

You can also insert "/y" if you want the batch file to delete temp files without prompting with the "Are you sure?" message, at the end of each line starting with "del"

Alternatively, you can useNT's autoexec.bat. Type "sysedit" at a run command. Paste the above text into the autoexec.bat file and select "file", "save" and exit.

As stated above, you can use the AT command to schedule this command to run at specific times if you require temp files to be deleted more often that at logon.

by estebandelatorre

Will be enought on every boot???

Make a .bat file like this:

cls
cd\
cd c:\temp
del *.*
cd c:\winnt\temp
del *.*
exit

Name the file winstart.bat and save into the root of your c: drive. Each time the os starts, the program will be launched. (oh, also set it to close on finish!)
It also works under win9X!

This discussion is closed to new replies.