Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Command to Delete Temp files for all User profiles in a Local Machine or Network  (Read 5378 times)

0 Members and 1 Guest are viewing this topic.

lino124

    Topic Starter


    Intermediate
    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!

    lino124

      Topic Starter


      Intermediate
      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.