Jump to content

AUTO DELETE TEMPORARY FOLDER.!


nsnraju

Recommended Posts

what i prefer is %temp% " without quotes.. at Start -> Run..this opens ur temp folder n den u cal erase it neatly// still try dis one too..

First go into gpedit.msc

Next select -> Computer Configuration/Administrative Templates/Windows Components/Terminal Services/Temporary FolderThen right click "Do Not Delete Temp Folder Upon Exit"Go to properties and hit disable. Now next time Windows puts a temp file in that folder it will automatically delete it when its done!

Note from Forum Admin: Remember, GPEDIT (Group Policy Editor) is only available in XP Pro.

Link to comment
Share on other sites


That might not be a good idea if you install software. If you install something that uses temp, then it prompts you to reboot, any install files will be deleted and won't be available on next boot.

And i believe that setting is for terminal services, not windows.

-gosh

Link to comment
Share on other sites

Here is a VBS script that will delete most of the things in the Temp folder.

I have only tested this on Vista and do not know how it will work on XP.

Save as CleanTemp.vbs

 On Error Resume Next 
Dim Act :Set Act = CreateObject("Wscript.Shell")
Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Tmp :Tmp = Act.ExpandEnvironmentStrings("%Temp%")
Dim F1, SubFolder, Folder
'/-> Collect All The Files In The Temp Folder
For Each F1 In Fso.GetFolder(Tmp).Files
If InStr(F1.Name,".bmp") Then
' WScript.Echo "Do Not Delete User Picture " & F1.Name
Else
' WScript.Echo F1.Name
Fso.DeleteFile(F1.Path),True
End If
Next
'/-> Collect All The Folders In The Temp Folder
ShowSubFolders Fso.GetFolder(Tmp)
Function ShowSubFolders(Folder)
For Each SubFolder in Folder.SubFolders
' WScript.Echo SubFolder.Path
Fso.DeleteFolder(SubFolder.Path),True
ShowSubFolders Subfolder
Next
End Function

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...