Change default location for Windows Temp Files?

IronChef

Distinguished
Sep 1, 2006
5
0
18,510
I am about to load up a new system and was doing alittle reading here and saw that a few users like to setup a seperate partition for the page file, Windows temp files & temp files for apps (such as CD/DVD buring)
Now I know the page file on a small differnet partition is not a bad idea & I know there are several apps that need a temp directory for temp files and that you can chage these with in the apps options, so no probs there.
SO the question is can someone let me know or just point some where to find out how to change the default drive/directory for windows temp files

Thanks ;)
 

mkaibear

Distinguished
Sep 5, 2006
678
0
18,990
Yup, it's easy.

Bring up Explorer, right-click on "My Computer", and select properties.

Go to "Advanced", then "Environment Variables". This pops up the box you need to make the changes in.

There are 4 places you need to change;

User variables (2) - change both TEMP and TMP to your chosen one (I have it set to Z:\TEMP\ for both)
System variables (2) - scroll down and change both TEMP and TMP to your chosen one.

If you've set a separate partition to hold them (as I have), it's also worth setting your Virtual Memory to point at this partition as well.

Although I would warn you, don't put them on a separate drive, then remove the drive from your system. Windows complains... :oops:
 

schwinn

Distinguished
Jul 25, 2006
50
0
18,630
I think you mean, where is the swapfile? Most people use a seperate partition for swapfiles, but not for temp files.

In either case, it's not that much of a benefit to do this, though some people will say it is. Yes, it can prevent fragmentation of the drive, and keeps the swap towards the "front" of the drive for fastest access, but the actual performance benefit of the "front of the drive" is not that big of a deal.

Personally, I wouldn't bother... there are many more important things to worry about.
 

mkaibear

Distinguished
Sep 5, 2006
678
0
18,990
There is a benefit to doing it, especially if you can put the temp files / swap files on a separate disk. I've got a "backups" disk, where i keep backups (surprisingly), and that's got a 10Gb partition on it for swap and temp.

This means it doesn't have to read the main disk all the time - for swap as well as for programs, etc.

It does provide a reduction in disk thrashing - doesn't make anything *faster*, but it reduces slowdown.
 

IronChef

Distinguished
Sep 1, 2006
5
0
18,510
Yup, it's easy.

Bring up Explorer, right-click on "My Computer", and select properties.

Go to "Advanced", then "Environment Variables". This pops up the box you need to make the changes in.

There are 4 places you need to change;

User variables (2) - change both TEMP and TMP to your chosen one (I have it set to Z:\TEMP\ for both)
System variables (2) - scroll down and change both TEMP and TMP to your chosen one.

If you've set a separate partition to hold them (as I have), it's also worth setting your Virtual Memory to point at this partition as well.

Although I would warn you, don't put them on a separate drive, then remove the drive from your system. Windows complains... :oops:

Thanks that is easy ;)
 

schwinn

Distinguished
Jul 25, 2006
50
0
18,630
There is a benefit to doing it, especially if you can put the temp files / swap files on a separate disk. I've got a "backups" disk, where i keep backups (surprisingly), and that's got a 10Gb partition on it for swap and temp.

This means it doesn't have to read the main disk all the time - for swap as well as for programs, etc.

It does provide a reduction in disk thrashing - doesn't make anything *faster*, but it reduces slowdown.
I hear both sides of the story often, and never see any data to back either side up. I have personally run it both ways, and seen little difference (then again, I have always had a decent amount of RAM on my systems, too). Until I see benchmark data proving one way or the other, I wouldn't bother.

Yes, in theory the faster part of the drive would help.
Yes, in practice, a fixed size (or fixed partition) would reduce fragmentation, but I defrag often enough that this, too, is not a problem.
 

mkaibear

Distinguished
Sep 5, 2006
678
0
18,990
>Yes, in theory the faster part of the drive would help.
>Yes, in practice, a fixed size (or fixed partition) would reduce fragmentation, but I defrag often enough that this, too, is not a problem.

You ain't listening to me! I didn't say that it should be good on a faster bit of the drive (that's largely rubbish, it's the random access time which is a factor, not the data transfer rate, certainly given the comparison with the access time and data transfer of main memory).

I also didn't say that it would reduce fragmentation - though I suspect it would, this isn't going to make much difference.

What it does do is simple - it stops you trying to use the same interface for both reading data off your disk and reading swap or temp information. Having them on the same disk requires the heads to run back and forth seeking data - especially if you're using your swap file. Having them on different disks means that when you are accessing the swap file your main disk can be accessed without any kind of slowdown.

I'm not saying it's going to make a massive amount of difference. But it is more efficient...
 

schwinn

Distinguished
Jul 25, 2006
50
0
18,630
Maybe I didn't read you correctly - sorry.

Reading from a different interface? On a separate drive and IDE channel, I assume? I guess this could work to help, but as you admitted, it's not that significant.

Worse yet, I often see people running an old, smaller drive for swap, as opposed to their main drive. I would imagine that the older technology of the old/small drive would be so much slower that this would result in a slowdown... yet people do it.

I'll stick to using my C: as the swap (or the other drive, if it's physically faster) and ignore partitioning tricks, or even thinking of IDE channel separation. It's just not that significant - that's my point.
 

mkaibear

Distinguished
Sep 5, 2006
678
0
18,990
>IDE channels

2 separate SATA channels, actually, but yes, the principle's the same.

>speed

For swap, it really doesn't matter. The difference between memory and hard disk is so great that whatever drive you choose to use (with the possible exception of an i-Ram(!)) will have no relative effect on the slowdown.

And again, that's not what I'm saying, anyway...

In essence, a hard disk reads data in the order it's had that data requested. If you're using the hard disk to read data relating to a program at the same time as reading and writing to the same hard disk for swap data, you're going to have problems - the heads will be flying back and forth between the data you want and the swap partition. This causes slowdown - if nothing else, because the hard drive is now using its cache to switch between the data you were wanting and the swap data.

Putting the swap file on a different drive (on a separate IDE/SATA channel) has the result that the main hard disk is only reading from one place on its disk, and the swap hard disk is only reading from one place on its disk.

This reduces the overhead on the IDE or SATA controller, and provides the data as quickly as possible for the CPU.

Does that make sense? I feel I've explained it badly...
 

schwinn

Distinguished
Jul 25, 2006
50
0
18,630
Agreed, on 2 channels, it may make a difference. NCQ on SATA would reduce this issue, but IDE has no such thing.

I just wanted to make sure people knew that dual partitions (ie, same drive) would yield little or nothing.

And, for those using separate drives, if the swap drive is an older, smaller, slower drive, it would probably reduce performance, too. Secondly, you have to ask if the data you are accessing is on the first or second drive... in which case, the swap should be on the "other" drive...

Anyway, I think we are in agreement on this. No sense to beat the horse :)

EDIT: One thing I found in my travels, was this webpage: http://www.tweakxp.com/article37023.aspx Intersting idea... not sure if it works, but I'll give it a shot!
 

mkaibear

Distinguished
Sep 5, 2006
678
0
18,990
>no sense to beat the horse.

What? I've only been on this forum for a while, but beating the dead horse seems to be what most people do all of the time!

:roll: ;)

>linky

That seems an interesting idea, not sure about the conclusions they are drawing - I used to have my swap file across multiple partitions and saw a performance boost from dropping it down to a single partition on a spare disk - so it's horses for courses, I guess!