Login to Account Create an Account
Automatically controlling Win Temp Folder
Posted 29 January 2013 - 06:06 AM
sorry if this has been discusssed before or if it seems trivial.
However, on my system the temp folder increases in content and size pretty quickly because some files just stay there.
So I thought about a batch in autostart just deleting them but there is always the danger that some files that may still be needed - maybe for completing an installation, etc. - are deleted.
So the solution would be to just delete files that are of a certain age and fortunately I found a cool little proggy.
It is called DELAGE32 and can be downloaded here from the authors page.
The awesome thing about the app is that you have several parameters for fine tuning.
I created a batch with these settings.
"... your path ... \delage32.exe" C:\WINDOWS\Temp\*.* 2 /includeH /includeRO /quiet
*.* :all files to be deleted but it could also be *.tmp, etc. !
2 :means that ONLY files older than 1 day are deleted (Not folders !!). Could be any number - even 1.
/includeH :also hidden files
/includeRO :also read-only files
/quiet :no action from user needed
After the first use the size of my temp folder decreased from around 20MB down to 4MB. Right now it is 2.5MB.
I love it and it can also be used on the recycle bin, etc.
Best wishes, MiKl
Posted 23 March 2013 - 08:12 PM
There's many years since I used the set of commands below in AUTOEXEC.BAT and I don't recall ever having a problem with an installation:
@DELTREE /y C:\windows\cookies >NUL @DELTREE /y C:\windows\history >NUL @DELTREE /y C:\windows\locals~1\tempor~1 >NUL @DELTREE /y C:\windows\tempor~1 >NUL @DELTREE /y C:\windows\temp >NUL @MD C:\windows\temp >NULThe above will remove any traces of cookies, document history, temporary internet files (from IE only) and the Temp folder, then it recreates Temp.
In the extreme situation that an application does require files in Temp upon reboot, you may temporarily disable deletion and recreation of Temp (place REM in front of each of the last two lines).
Oh and I never use Recycle Bin, it's completely disabled - everything I delete goes directly into the void. Virii do have the nasty habit of hiding in there too.
Posted 24 March 2013 - 06:16 AM
Edited by Greenpalmer, 24 March 2013 - 04:15 PM.
Posted 06 April 2013 - 09:25 AM
It runs from a shortcut on my desktop and also a shortcut in my 'Startup' folder.
I started with the batch file lines in the former post, and then added a few more, specific to my own PC, to also delete the cache from Firefox, the Prefetch folder, the Recycle Bin, etc. *
* When using Deltree.exe, if you create a line that says "Deltree /y "C:\temp" it will totally remove the 'temp' folder. That's not exactly what we need to do. We only need to empty the folder, not delete it. So the line should actually read, "deltree /y "C:\temp\*.*"
That will empty the folder and leave the folder itself alone.
Do that with every folder that you desire to "Empty".
Or you can get specific.....deltree will let you just delete a certain file or group of files from a folder.
For instance I found very old temp files in my Windows folder, so the Deltree command to clean up that little mess would read:
Deltree /y "C:\Windows\*.tmp"
where only the temp (.tmp) files would be deleted and all other files would be left alone.
The Deltree.exe command is probably the most versatile and powerful command ever written into DOS by MS. I hate that they opted to abandon it in XP and won't even let it run in later OS's.
They did, however, expand the options for the Delete command that can be used instead.
Even .tmp files and Temporary Internet Files are stored in multiple locations in Windows, so those locations can be added to your XPCleanup batch file. Just do a file search for .tmp and you'll find all their hiding places. Add all those locations to your own cleanup batch file.
Your own cleanup batch file will grow exponentially as you search out locations where junk files like to hide.
My own XPCleanup batch file is now about thirty lines long.
But it still takes only a few seconds to run.
I put a generic copy of my XPCleanup.bat program on my web site for quick and easy download.
All the way, up through Windows ME, the "Deltree.exe" file was present in Windows. But for XP the file had to be copied over from a previous OS. And, to keep things simple, I just put it in the root directory. It will not run at all in Vista, Win-7 & Win-8. You have to use the Delete command on those OS's.
That modified batch file is in my Windows 7 Stuff .rar file on my website.
Just for fun, I wrote a modified XPCleanup batch file, that first counts all the files on the C drive, and then deletes all the common junk files, then counts the files again and posts the difference.
That's the number of junk files that it deleted. I like to run that on PC's that I've never worked on before, that still run XP. On one recent house-call, I ran that on a man's PC and it took out over 100,000 junk files. We had a nice little chat for the several minutes that it took that program to run.
His complaint was, "my PC is running so slow, I can't stand it anymore!".
Oh yes, that PC also had several hundred trojans and pieces of Spyware on it.
Once de-bugged, tweaked and cleaned, that little PC ran better than new.
Keeping one's PC clean, neat, defragmented and running at top performance, isn't rocket science, , , it's just a matter of using what has already been supplied to us in Windows (and sometimes DOS).
Again, for max OS efficiency, I highly recommend that anyone wanting to run XP/SP3, do try to get up to 2 gig's of ram installed.
Yes, XP will run on 256 meg's of ram, but not efficiently. Two gig's seems to be the sweet spot.
Long Live XP!
Edited by Andromeda43, 06 April 2013 - 09:55 AM.
Posted 06 April 2013 - 09:40 AM
XP (and probably later versions too) can automatically run batch files at startup and upon shutdown.
Start > Run > gpedit.msc > Enter/OK will open up the Group Policy editor.
Computer configuration > Windows settings > Scripts (Startup/Shutdown)
Add the batch scripts to be run on startup and/or shutdown, respectively.
Posted 06 April 2013 - 09:57 AM
Sure it does, with the "right" switches:
If I recall correctly, there's the RD (remove directory) command in NT-based Windows as a counterpart for 9x's DELTREE. I'm not sure, however, if ti works for non-empty directories or what are the accepted parameters, if any.
In case of need....:
BUT here we are in "Windows 9x / ME"....
Posted 08 April 2013 - 06:53 AM
Thanks for the links!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users