Jump to content

Delete temp folder on shutdown automatically


Pouria
 Share

Recommended Posts

I've searched around but I'm unable to find and easy/safe way of doing this.

What I do is run Ccleaner just before I shut my computer down. I realise it is not automatic but, I do like to keep control of things like deleting files.

Link to comment
Share on other sites

If you're using XP Pro/XP MCE...

I'll assume you mean the %TEMP% folder.

RMDIR /S /Q %TEMP%

The above will remove the %TEMP% folder and everything in it. However the %TEMP% folder will be recreated when windows starts.

To make it kick in at shutdown you need to setup a logoff script.

Start, Run, Type: gpedit.msc and click OK.

User Configuration > Windows Settings > Scripts (Logon/Logoff)

Double click: Logoff

Unzip the attached file.

Click: Show files... and drag del_temp_folder.bat into the folder.

Then click Add..., Browse and double click del_temp_folder.bat

Click OK.

Restart your PC and you will find the %TEMP% folder is there but will only [if anything] have a few items in it.

Also note that items in the %TEMP% folder are either needed or not. Upon shutdown I wouldn't know if this folder is needed and if it is then running the script might cause havoc so before you do the above make a backup just to be sure.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy