What is the Command to Delete Temp files for all User profiles in a Local

By Dolphin111 ·
I have a network computer that is used by more than 50 users per month, i have recently realized that the temp folder of each users as grown big and are consuming PC resources i want to delete all the Items in the TEMP folder of all the users that have logged on or used this computer, well doing it one by one is timing consuming and hard work too, because there is a profile for more than 100 users in.
I would like to know if there is a COMMAND that i can RUN to do this work for me? if so kindly advice. By the way the OS is Windows XP Professional. Also let me no if i can run it on the Network?

Thank u!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Delete Temp Files for Each User Profile on Windows

by Dolphin111 In reply to Delete Temp Files for Eac ...

Peconet thanks for your timely response.

I know this might a bit embarrassing, but i have to admit that i dont have any knowledge how to run scripts, i saw the websites you suggested and i just dont know how to run
those scripts i mean i want to know if i type that in command prompt or is i should get a specific software to run the scripts? I dont understand anything about coding will u suggest a specific code string for my specific issue?

I would really appreciate

Collapse -

no problem...

by computechdan In reply to Delete Temp Files for Eac ...

open up my computer, browse to a folder where you would like to store the file.

click on tools, folder options, view, uncheck
"hide extensions for known file types"
click ok

now click file, new, text document, open the new document then copy/paste only the part in between the ***** into it:

@echo off
cd /D C:\Documents and Settings
REM ?-Clean Temp Folder?
for /D %%a in (*.*) do DEL /F /S /Q "%%a\Local Settings\Temp\*.*"
for /D %%a in (*.*) do FOR /D %%b IN ("%%a\Local Settings\Temp\*.*") DO RMDIR /S /Q "%%b"
REM ?-Clean IE Cache?
for /D %%a in (*.*) do DEL /F /S /Q "%%a\Local Settings\Temporary Internet Files\*.*"
for /D %%a in (*.*) do FOR /D %%b IN ("%%a\Local Settings\Temporary Internet Files\*.*") DO RMDIR /S /Q "%%b"

next you will close the text file allowing it to save.

then rename the file to whatever u wish, but make sure the extension is .cmd

reply yes to the warning about changing the extension.

like so: del_all_user_temp.cmd

now u can run this file manually as needed or it can be scheduled to run periodicly.

hope this helps ya out, if so mark this post as well as Peconet's post as usefull, as i used the first link from his post and doctored up the script as was described there.
certainly will help me out, as i have been meaning to make one of those for some time

Collapse -

Thanks it works just fine

by Dolphin111 In reply to no problem...

Well this does the job exactly as i wanted it to. Thank you all for your timely help and support.

Collapse -

your welcome

by computechdan In reply to Thanks it works just fine

yall come back now ya hear?

Collapse -


by Jacky Howe In reply to your welcome

you got your first Thumb, congrats. Good Tip too.

Collapse -

ty ty

by computechdan In reply to Hey

had to beg a bit, but oh well.... since u readin this thread, wat the heck does <nt> mean? noticed it in a number of posts

Collapse -

I would think

by Jacky Howe In reply to Hey

that it is short for Thank You. Boxie is always adding new things to her posts that I don't know the meaning of until I look it up.

Edit: or did you mean congrats, if so it's short for congratulations.

Collapse -

Commands that everybody can use

by Peconet Tietokoneet In reply to Delete Temp Files for Eac ...

This will give you a little help on the Script ladder:

Print it out and keep it as reference.

Collapse -

Profile cleanup

by rush222 In reply to What is the Command to De ...

Add as script that runs DEL /F /S /Q %TEMP% on logoff or logon. This will run for each user when they logon/logoff and cleanup temp directory for each user.

Related Discussions

Related Forums