Deleting Multiple Temp and Temp Internet files

G

Guest

Hi, i want to create a small bat file that will run on start up, that will
delete the TEMP and TEMPORARY INTERNET FOLDER on all 3 user accounts.

I understand that XP does not support the deltree command, what is the
alternative?

would something like the following be suitable:

CD Documents and Settings\tony\Local Settings\Temp
del *.*

....

then change the direcory for the next user....

CD Documents and Settings\mike\Local Settings\Temp
del *.*

etc.

would something like this work?

ALSO, how would i delete the temp internet files for the other users, as in
the other users "temp internet folder", there are a further 4 folders.

regards
 
M

Mikhail Zhilin

You can use:

del /Q /S *.*

command -- run in DOS window:
del /?
to get more help.

But I absolutely can't recommend to change directory and then execute
this command: if the path does not exist (like that may be in your
example, when there are no double quotes in CD command -- and, moreover,
no leading backslash) -- the wrong folder will be emptied. So it is
strictly preferable to use the full folder name, like:

DEL /Q /S "C:\Documents and Settings\tony\Local Settings\Temp\*.*"
DEL /Q /S "C:\Documents and Settings\mike\Local Settings\Temp*.*"

etc
--
Mikhail Zhilin
http://www.aha.ru/~mwz
Sorry, no technical support by e-mail.
Please reply to the newsgroups only.
======
 
A

Alex Nichol

Pinto1uk said:
Hi, i want to create a small bat file that will run on start up, that will
delete the TEMP and TEMPORARY INTERNET FOLDER on all 3 user accounts.

I understand that XP does not support the deltree command, what is the
alternative?

would something like the following be suitable:

CD Documents and Settings\tony\Local Settings\Temp
del *.*

Use the /S switch in DEL to delete subfolders and their contents.

It is unwise to delete TEMP too early; software installs that want a
reboot to a second phase have often left files there that are then
wanted.

I suggest not trying to delete all three in one go; Use the %TEMP%
variable to get to the folder, and run it from the
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
key where it is late enough in the process to be safe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Temp Internet Files 2
Deleting Temp Internet Files 3
Temporary Internet Folder 2
BAT FILE 2
temp files 8
Temp Folder Files 3
temp files 6
temp folder 3

Top