Computer Hope

Software => Internet browsers => Topic started by: lino124 on June 07, 2009, 04:33:12 AM

Title: Command to Delete Temp files for all User profiles in a Local Machine or Network
Post by: lino124 on June 07, 2009, 04:33:12 AM
Hello everyone!

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!
Title: Re: Command to Delete Temp files for all User profiles in a Local Machine or Network
Post by: lino124 on June 09, 2009, 04:12:57 AM
Hey guys thank u so much for passing by and for having viewed the post.
I did some google search on the issue i found useful staff but i got it from another IT forum website, i thought i might post it here for future references.

@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"


this script does the job just fine.