Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Automatically controlling Win Temp Folder

- - - - -

  • Please log in to reply
6 replies to this topic

#1
MiKl

MiKl

    Member

  • Member
  • PipPip
  • 107 posts
  • OS:98SE
  • Country: Country Flag
Hi Guys,

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.
@echo off
"... 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


How to remove advertisement from MSFN

#2
Drugwash

Drugwash

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,241 posts
  • OS:98SE
  • Country: Country Flag
Such leftovers may cause huge problems. Some virii place their components in the temporary folder and they launch at startup.
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 >NUL
The 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.

#3
Greenpalmer

Greenpalmer

    Newbie

  • Member
  • 26 posts
  • OS:98SE
  • Country: Country Flag
You can use CCleaner - 2.36 from FileHippo is the last to work on Win 98 - and add C:\Windows\Temp as an Include in it's Options.

Edited by Greenpalmer, 24 March 2013 - 04:15 PM.


#4
Andromeda43

Andromeda43

    Retired PC Tech.

  • Member
  • PipPipPipPipPipPip
  • 1,018 posts
  • OS:XP Pro x86
  • Country: Country Flag
Going all the way back to Windows 98, I've been using a batch file to do my daily housework (cleanup) on my PC.
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. :wacko:
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.
www.drwho.in

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!

B)

Edited by Andromeda43, 06 April 2013 - 09:55 AM.

A person with experience is never at the mercy of a person with an argument.

#5
Drugwash

Drugwash

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,241 posts
  • OS:98SE
  • Country: Country Flag
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.

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.

#6
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,086 posts
  • OS:none specified
  • Country: Country Flag

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.

Sure it does, with the "right" switches:
http://ss64.com/nt/rd.html

In case of need....:
http://reboot.pro/to...files-and-more/

BUT here we are in "Windows 9x / ME".... :ph34r:

jaclaz

#7
Drugwash

Drugwash

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,241 posts
  • OS:98SE
  • Country: Country Flag
Yeah well, as long as there's mixed information, it better be as condensed as possible. We don't like 9x haters, so let's not be XP haters ourselves. ;)
Thanks for the links! :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN