Can I limit the size of my Temp File?

D

David Schwartz

Hi all. Thanks for taking the time to read this and possibly help me. I
noticed that my original C Drive which has a 40GB (actually 37) capacity was
nearly full. I was browsing the folders to see where the culprit was and
found that a folder called Temp Files (C:\Documents and Settings\David
Schwartz\Local Settings (a hidden file)\Temp) was engorged with 17.7GB of
supposedly temporary material. I was amazed. Before I did anything stupid
like delete the contents of the folder, I thought I'd ask first.

Can I delete the contents of this folder?
Can I prevent this from happening again?
Can I limit the size of the folder?
Is there a setting to delete the contents after whatever application is
using it is finished?

Thanks in advance.
 
G

Guest

Yes!
You may delete all the content of this folder and you should frequently
delete content of this folder. Also you should clean 'Temporary internet
files' in the "Local settings" more frequently.

--Mukul
 
N

Newbie Coder

David,

Yes you can safely delete the contents of the TEMP folder, but some of the
files that begin with '~' may not delete as they will be locked write access
usually

Not heard of anything that can limit its size because it will use available
hard drive space

Programs that are installed or being used may create temporary files &
because mainly sloppy coders don't clean up after themselves, hence the junk
left in that directory

I wouldn't bother installing a junk cleaner either because you can use the
built in one called Disk Cleanup (START | ALL PROGRAMS | ACCESSORIES |
SYSTEM TOOLS | DISK CLEANUP)

The only thing you can do is to keep the TEMP directory as clean as possible
simply like this:

Click START | RUN
Type %temp% & click OK (or press ENTER)
CTRL + A (Select All (or highlight the one to be deleted (remember the '~'
files)))
Press DEL
Press ENTER

But remember you can clean the 'C:\Windows\Temp' directory,Cookies,
Temporary Internet Files too which may give you a few extra KB
 
R

Rock

David Schwartz said:
Hi all. Thanks for taking the time to read this and possibly help me. I
noticed that my original C Drive which has a 40GB (actually 37) capacity
was nearly full. I was browsing the folders to see where the culprit was
and found that a folder called Temp Files (C:\Documents and Settings\David
Schwartz\Local Settings (a hidden file)\Temp) was engorged with 17.7GB of
supposedly temporary material. I was amazed. Before I did anything stupid
like delete the contents of the folder, I thought I'd ask first.

Can I delete the contents of this folder?

Yes, after a reboot to ensure any pending program installs are handled.
Deleting the contents should be done regularly.
Can I prevent this from happening again?

Only by deleting the contents.
 
T

Terry

On 5/14/2007 5:11 AM On a whim, David Schwartz pounded out on the keyboard
Hi all. Thanks for taking the time to read this and possibly help me. I
noticed that my original C Drive which has a 40GB (actually 37) capacity was
nearly full. I was browsing the folders to see where the culprit was and
found that a folder called Temp Files (C:\Documents and Settings\David
Schwartz\Local Settings (a hidden file)\Temp) was engorged with 17.7GB of
supposedly temporary material. I was amazed. Before I did anything stupid
like delete the contents of the folder, I thought I'd ask first.

Can I delete the contents of this folder?
Can I prevent this from happening again?
Can I limit the size of the folder?
Is there a setting to delete the contents after whatever application is
using it is finished?

Thanks in advance.

Hi David,

You can delete the contents of the folder, as others have suggested. I
have a batch file placed into my Startup folder that deletes the
contents of any temp folders. That way every reboot all the files are
removed. This doesn't affect any install programs as the Startup folder
is the last thing processed.

Can you prevent it? Yes, as others have suggested or by using the
method I described above.

Can you limit the size of the folder? Yes. You could create a small
partition and move your temp folders there (in the Advanced tab of
System Properties under the Environment Variables button, there are 4
variables to change, 2 in User, 2 in System). Of course you would want
to make it large enough for install programs, updates, etc. to run.

There isn't any setting in programs or Windows other than using Disk
Cleanup.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
R

Rock

Can you limit the size of the folder? Yes. You could create a small
partition and move your temp folders there (in the Advanced tab of System
Properties under the Environment Variables button, there are 4 variables
to change, 2 in User, 2 in System). Of course you would want to make it
large enough for install programs, updates, etc. to run.

Aye there's the rub, in knowing how big to make it. Make it too small and
could there be problems? I'm not sure, but I would guess in certain
situations, yes. Creating a separate partition seems to be a lot of effort
to limit temp file sizes but you are right, that is a way to limit it. I
didn't think about that.

<snip>
 
T

Terry

On 5/14/2007 3:53 PM On a whim, Rock pounded out on the keyboard
Aye there's the rub, in knowing how big to make it. Make it too small and
could there be problems? I'm not sure, but I would guess in certain
situations, yes. Creating a separate partition seems to be a lot of effort
to limit temp file sizes but you are right, that is a way to limit it. I
didn't think about that.

<snip>

Agreed. I would think a couple hundred meg would be more than enough as
long as it was cleaned regularly, but figuring the OP had 17 gig of temp
stuff, even a 1 gig would at least give it a "max". And creating
partitions is pretty easy now days, but may seem daunting to a new user.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
R

Rock

On 5/14/2007 3:53 PM On a whim, Rock pounded out on the keyboard
Agreed. I would think a couple hundred meg would be more than enough as
long as it was cleaned regularly, but figuring the OP had 17 gig of temp
stuff, even a 1 gig would at least give it a "max". And creating
partitions is pretty easy now days, but may seem daunting to a new user.

Yeah pick your poison. Set up a partition for it, or remember to delete the
temp files either manually or with something like Disk clean up or
Ccleaner.
 
B

Bruce Chambers

David said:
Hi all. Thanks for taking the time to read this and possibly help me. I
noticed that my original C Drive which has a 40GB (actually 37) capacity was
nearly full. I was browsing the folders to see where the culprit was and
found that a folder called Temp Files (C:\Documents and Settings\David
Schwartz\Local Settings (a hidden file)\Temp) was engorged with 17.7GB of
supposedly temporary material. I was amazed. Before I did anything stupid
like delete the contents of the folder, I thought I'd ask first.

Can I delete the contents of this folder?

Yes.


Can I prevent this from happening again?


Not really; the best you can do is develop regular maintenance habits
which would include cleaning out the Temp folders. One tool that can
help is CCleaner (just don't use its registry "cleaning" function):
http://www.ccleaner.com/

Can I limit the size of the folder?


I don't think so; nor would it be a good idea - you don't want to "run
out of disk space" 90% of the way through an applications installation.
Is there a setting to delete the contents after whatever application is
using it is finished?

Not that I know of; properly written applications already clean up
behind themselves.

More space-saving tips:

A primary space waster within each user profile would be IE's
penchant for storing copies (or significant portions thereof) of nearly
every web page youhave ever visited. Try reducing the amount of
temporary Internet files cached, which is huge by default. I always
reduce it to a maximum of 50 Mb. In Internet Explorer, click Tools >
Internet Options > General, Temporary Files > Settings.

Same principle for the Java cache. Start > Control Panel > Java >
Temporary Internet Files > Settings.

The System Volume Information is the folder in which WinXP's System
Restore feature stores information used to recover from errors. By
default, WinXP sets aside a maximum of 12% of the partition's size for
storing System Volume Information, but the amount of space set aside for
this purpose can be adjusted by the user. Start > All Programs >
Accessories > System Tools > System Restore > System Restore Settings,
select the pertinent partition and click Settings. If you don't want to
use System Restore at all, simply turn off the System Restore feature
(Start > All Programs > Accessories > System Tools > System Restore,
System Restore Settings) and reboot. This will delete all of your
Restore Points, freeing up the hard drive space.

Another great waster of space can be the Recycle Bin. By default,
this takes up to 10% of your hard drive capacity. On today's large hard
drives, this is tremendously wasteful. It can be set to a lower limit
by right-clicking the desktop Receycle Bin icon, selecting Properties,
and using the slider bar to lower the maximum size to something more
reasonable -- 1% to 2% should be more than enough space.


--

Bruce Chambers

Help us help you:



They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -Benjamin Franklin

Many people would rather die than think; in fact, most do. -Bertrand Russell
 
M

Malvern

This is added information...

There may be more than one temp folder on your system. To find, go to
Search and type *.tmp in subject line. I created a special folder for
shortcuts to the containing folders. I check them regularly.

Examples of extra temp folders include one each for printer and Office here.

Malv
 
T

Terry

On 5/14/2007 7:22 PM On a whim, David Schwartz pounded out on the keyboard
Can you explain the "batch file" and how to initiate it, please.

I have a folder called utils that I keep my batch files in. There are
many ways to write a "cleaning" batch file.
1. Direct all your temp files to a single location like I described above.
2. Create the batch file
Method 1 Open Notepad and type:
rd c:\temp (if c:\temp is the location you selected in #1)
md c:\temp (if c:\temp is the location you selected in #1)
Click File Save As and type "cleantemp.bat" with quotes to the folder of
your choice. Create a shortcut to the batch file and place it into your
Startup folder.

Method 2
Requires deltree.exe (you can find this on the internet and place it
into your utils folder).
Open Notepad and type:
deltree.exe /y c:\temp\ (if c:\temp is the location you selected in #1)
Click File Save As and type "cleantemp.bat" with quotes to the folder of
your choice. Create a shortcut to the batch file and place it into your
Startup folder.

You can also direct the batch file to clean other folders (cache, etc.)


--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
D

David Schwartz

Thanks. I think I need to educate myself more on this before I do it. But
I will.
 
D

dobey

In your case the batch file would look something like what's below.
cut between lines and paste into notepad.
________________________

REM RD = remove directory

RD /s /q "C:\Documents and Settings\David Schwartz\Local Settings\Temp"

REM MD = make directory

MD "C:\Documents and Settings\David Schwartz\Local Settings\Temp"

_________________________________

Save/rename the file as tempdelete.bat, (must have .bat extention, not
..txt), and place a shortcut to the batch file in your startup folder.
Every time you boot the PC these commands will be carried out.

The REM command (REMark) makes the line invisible to windows and does
nothing.

The quotation marks around the path are just to be safe - under DOS the OS
would stop at the first space and consider that the full path, probably exit
with "file/path not found" message, unless you have a directory with that
name. Can't recall if XP needs them, but it won't hurt.

RD /s /q, (Remove Directory), deletes the directory.
/s removes all directories and files contained within,
/q doesn't ask for confirmation.
I did a quick test and if you don't use these switches the directory won't
be deleted because it is not empty.
If you want to delete other temp folders, add them in using the same syntax
i.e. RD /s /q "path to directory"

MD, (Make Directory), creates a new directory, in this case your temp
directory.

I'm not even sure MD matters as in most cases programs/Windows will simply
create a directory it needs.
--------------------------------------------------------------------------------------
!!You should double check the path to make sure it matches your temp
file!! <
---------------------------------------------------------------------------------------
Also, there is a chance a file Windows is using, (Perflib*.dat), file might
be there. In this case when this file comes to be deleted it won't be
deleted, and neither will any file that hasn't already been deleted. Offhand
I don't know what process creates this file, but it always seems to be in my
temp directory when I look

It just depends on what order startup items are processed when Windows
starts, and when any temp system file might be created. You can test by
putting a bunch of files in the temp directory, reboot, then check to see if
they have been deleted or not.

Also you may need to be logged in under an admin account for this to work -
maybe someone can confirm.

If you want some more info, open a Command Prompt and type help, hit enter
and a list of commands you can use will be displayed. If you want more info
on a specific command type help REM. This will give you more information on
the REM command.

You can do quite a lot with batch files.
HTH.


David Schwartz said:
Thanks. I think I need to educate myself more on this before I do it.
But I will.
<snip>
 
T

Terry

On 5/14/2007 7:27 PM On a whim, Malvern pounded out on the keyboard
This is added information...

There may be more than one temp folder on your system. To find, go to
Search and type *.tmp in subject line. I created a special folder for
shortcuts to the containing folders. I check them regularly.

Examples of extra temp folders include one each for printer and Office here.

Malv

TEMP and TMP paths (for User & System) are variables you can change
under Environment variables, as I stated to the OP.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Limit Size of Temp File 20
Can I Delete Temp folders 11
Which Temp folders to delete? 6
deleting contents of Local Settings/Temp 5
WINDOWS\Temp directory size 4
Temp Temptation 9
Temp Files 4
Deleting Temp Files ?? 4

Top