Questions

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

Tags:
+
0 Votes
Locked

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

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!
  • +
    0 Votes
    Dolphin111

    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

    +
    0 Votes
    computechdan

    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

    +
    0 Votes
    Dolphin111

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

    +
    0 Votes
    computechdan

    yall come back now ya hear?

    +
    0 Votes

    Hey

    Jacky Howe

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

    +
    0 Votes
    computechdan

    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

    +
    0 Votes
    Jacky Howe

    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.

    +
    0 Votes

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

    http://commandwindows.com/command2.htm

    Print it out and keep it as reference.
    Enjoy.

    +
    0 Votes
    rush222

    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.

    +
    0 Votes
    PurpleSkys Moderator

    truly, the post is over a year old

    +
    0 Votes
    attu506

    click start button on the desktop
    click on run
    in the run prompt window, type:
    %temp%
    in the temp folder, click ctrl+a, then click shift+del
    if all the files are not deleted at once, you can select few and then delete.

  • +
    0 Votes
    Dolphin111

    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

    +
    0 Votes
    computechdan

    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

    +
    0 Votes
    Dolphin111

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

    +
    0 Votes
    computechdan

    yall come back now ya hear?

    +
    0 Votes

    Hey

    Jacky Howe

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

    +
    0 Votes
    computechdan

    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

    +
    0 Votes
    Jacky Howe

    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.

    +
    0 Votes

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

    http://commandwindows.com/command2.htm

    Print it out and keep it as reference.
    Enjoy.

    +
    0 Votes
    rush222

    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.

    +
    0 Votes
    PurpleSkys Moderator

    truly, the post is over a year old

    +
    0 Votes
    attu506

    click start button on the desktop
    click on run
    in the run prompt window, type:
    %temp%
    in the temp folder, click ctrl+a, then click shift+del
    if all the files are not deleted at once, you can select few and then delete.