View Full Version : Clear Temp Folder on Shutdown
Xaeryth
01-31-2002, 04:49 PM
There has to be a way to do this. Please, if you know, let me know. Thx.
TonyKlein
01-31-2002, 06:10 PM
There are third party apps that allow you to do that.
But also take a look here: <a target="_blank" href=http://www.forrestandassociates.co.uk/pcforrest/shutdown_programs.htm>How To Automatically Run Programs At Shutdown</a>
Good luck, Tony
<P ID="edit"><FONT class="small">Edited by TonyKlein on 01/31/02 12:14.</FONT></P>
report_2
02-01-2002, 12:05 AM
I am unable to tell you how to do this because it is not a very good idea to do this on any machine that may require an application installation.
Many programs place files in the Temp folder that are required when the installer tells you you must restart your computer to complete the install.
They will not be there anymore.
Also, I have seen ways of doing this upon startup but not before shutdown. Langa.com has nice .bat for this.
http://www.langa.com/cleanup_bat.htm
coolsights2000
02-01-2002, 12:38 AM
Good answer report_2 the same thing crossed my mind when I read it.. I have seen allot of forums posting the stuff to put in the .bat file on startup to clean stuff up but when you do that it get windows all screwed up... IT is just causing trouble....
I leave it alone until I defrag... Before I defrag I empty the temp folders using the GUI in the explore when you right click on the root c:\ and select properties you will see the clean up disk button... I also go on each desktop and use IE to clean out the temp folders.... then if any thing is left in the c:\windows\temp I get rid of it....
also you can do a search on the hard drive for *.tmp files and delete them
don't delete any thing that is a back up like .bak .old .1st and there is a few more
Use separtate users internet temp folder so when you do clean up all of the stuff will be gone.. When you use the same folder for all... windows get mixed up...
also if you have IE 6.0 there is an option to empty folders when closing IE this doesn't include the temp folder you are refering to...
Thanks
Mac!!!
This Is just my opinion
So if it stinks wait for another one
Cause I'm no expert
report_2
02-01-2002, 02:19 AM
You do have to watch out for the .tmp files as templates also have the .tmp extension.
I use the saved Find Files for Temp and TIF to empty them manually before shutdown. It takes all of 30 seconds or so.
vette75
02-01-2002, 03:06 AM
Deleting Temporary Files Painlessly
See Addendum for Windows ME and Windows 2000
This article is not intended to be a DOS lesson or tutorial, but to show you a simple and painless way that I help keep my drive free from useless file clutter. There are other command variations to do this, however, this is what I have found to work best for me. This article assumes that you already have a basic knowledge of DOS commands, the autoexec.bat file and the consequences of typos and the incorrect use of wildcards.
The temporary internet files folder, history folder and cookies folder contain a file called index.dat. Windows uses index.dat to keep a coded record of the files in the folder where it resides. Windows will NOT let you delete index.dat! If you delete the files in these folders through any Windows method, you are still left with the index.dat containing all the info you thought you just deleted. So much for deleting your tracks! This file can become completely bloated, not to mention corrupted, since it won't match the actual files in the folder. The index.dat file can only be deleted in DOS and are included in your cleanup using the DELTREE command.
All modifications are done in the autoexec.bat file. This is my preference so that these files are deleted each time I boot. The autoexec.bat file is not required after Windows 3.1. If you do not have this file in the root directory of your C:\ drive, just create it in Notepad (make sure that the "Word Wrap" option is OFF) and save as autoexec.bat. The file could actually be saved as "whatever_you_want_to_name.bat" file, but would have to be ran manually and in DOS mode. (Not a DOS window)
If I ever use Netscape, (far and few between) I have the cache files directed to my C:\Windows\Temporary Internet Files location rather than adding yet another directory to clean. If you use a Netscape browser, your cache files may be in the default location at: C:\Program Files\Netscape\users\username\cache (or whatever drive Netscape is installed) Just add another DELTREE line with the path where they can be found.
Here is a copy of my autoexec.bat file with explanation of the commands below. The grayed out lines are what existed before I added the cleanup routine. (Yes, I know neither is necessary, but I have my own reasons) Make sure you change any paths where your files may be kept in different folders than mine and delete out any lines of folders you decide not to have cleaned up.
--------------------------------------------------------------------------------
autoexec.bat File
@ECHO OFF
rem - By Windows Setup - c:\windows\command\mscdex.exe /D:aspicd0 /M:12 /L:I
PATH=%PATH%;
if exist c:\windows\smartdrv.exe c:\windows\smartdrv.exe 2048 16
DELTREE /y c:\windows\history\*.* > NUL
DELTREE /y c:\windows\tempor~1\*.* > NUL
DELTREE /y c:\windows\temp\*.* > NUL
DELTREE /y c:\windows\cookies\*.* > NUL
DELTREE /y c:\windows\applic~1\micros~1\office\recent\*.* > NUL
DELTREE /y c:\windows\ShellIconCache
if exist del c:\windows\ff*.tmp
if exist del c:\windows\system\advert.dll
--------------------------------------------------------------------------------
@ECHO OFF suppresses the "command" from displaying on the screen. Normally, when commands are executed from a batch file, they are displayed on the screen.
if exist is a conditional command that says if the file exists, load it. If it does not exist, no big deal, no error message and the command is ignored.
smartdrv.exe is a standard disk cache used to speed things up. It's not needed for Windows, like the old days, but sure speeds things up in DOS. Parameters are the amount of memory in Kb to use.
DELTREE allows you to delete a directory even if it contains files and subdirectories or has hidden, system or read-only attributes.
/Y Suppresses a prompt to confirm the deletion.
*.* delete all the files and subdirectories but leave the directory itself. This saves adding an additional command line to recreate the folder.
> NUL instruction disables output to the screen as your computer boots. Without it, error messages about "files not found" and a file by file line as each file is being deleted.. If a folder is already empty, you would also get an error message. If you would like to see exactly what is going on, just delete the > NUL part.
ShellIconCache is a hidden file in the Windows directory that stores icon cache files. Just like the temporary internet files folder, it becomes very unproductive when the file gets too big. This file can become very bloated and corrupted. (example: black, odd looking icons)
if exist del c:\windows\ ff*.tmp deletes garbage files that Office leaves behind, if they exist.
if exist del c:\windows\system\ advert.dll deletes the spyware file (advert.dll) that many demo programs install with their program. This file is always secretly loaded and running on your system. It reports ALL of your online activities back to the originator.
See Addendum for Windows ME and Windows 2000
Also, we have a great thread going on the subject here. A lot is covered here that I keep seeing in the same emails again and again.
--------------------------------------------------------------------------------
Reader Andy, pointed out another line to add, that I hadn't since I have these files deleted on shutdown with a registry tweak. Thanks, Andy.
DELTREE /y c:\windows\recent\*.* > NUL
coolsights2000
02-01-2002, 07:12 AM
did you read report_2 post
Many programs place files in the Temp folder that are required when the installer tells you you must restart your computer to complete the install.
They will not be there anymore.
my index.dat files do not get bloated because I use the GUI to clean house and put the internet temp folder for each users in a different place when I do clean up all of it is gone.....
You are just looking for troulble by adding all those lines
You can clean house very easy using the GUI
Just look at IE 6.0 there have been allot more function added
and yes I am spouting here as I tell my users when you get your own puter you can do as you please....
I am presently working with a person thur email that I have known for years that would not listen to me about how to set up her puter... it has gone down many times because the person that she has listened to added junk like this and would not set it up to block stuff the right way.... She finaly broke down and told them to load it up with the basics and I am working on the rest thur email...
Thanks
Mac!!!
This Is just my opinion
So if it stinks wait for another one
Cause I'm no expert
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.