Temp folder

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
phenix0000
Member
Posts: 88
Joined: Mon Jun 25, 2001 2:24 am
Location: Canada

Temp folder

Post by phenix0000 »

I have set up a Temp folder on another partition and was wondering if anyone knew how to set windows to put all the TEMP files in that folder instead of the usually C:\windows\Temp

I think I remember it got something to do with the registry, but I'm not positive.
Any advice would be helpful.
New things are learned everyday,
While old things are forgotten.
User avatar
TonyT
SG VIP
Posts: 10356
Joined: Fri Jan 28, 2000 12:00 am
Location: Fairfax, VA

Post by TonyT »

Not sure yopu can do that because many apps and install programs use te Temp folder and it's use is hard coded into the apps themselves. You'd end up w/ 2 Temp folders being used.

You can however put the Temp Internet Files folder anywhere you want.
No one has any right to force data on you
and command you to believe it or else.
If it is not true for you, it isn't true.

LRH
4oh4
Member
Posts: 46
Joined: Tue Jan 01, 2002 4:44 pm

Post by 4oh4 »

I'm sure a lot of programmers do hardcode the temp path into their apps (even though m$ provides a simple api function for that---GetTempPath). .....lazy programmers. :rolleyes:

But you can still set that path yourself. In win9x and probably me too, just add "SET TEMP=C:\your\temp\dir" to your autoexec.bat (or type it in a dos box every single time you start windows ;) ). In nt/2k go to the "system" applet in the control panel and on the "advanced" tab there's a button that says "Environment Variables". Click that and in the dialog that pops up type "TEMP" or "TMP" (at least in win9x you could use "tmp" but most people just use "temp") in the "Variable Name" field and type the temp dir that you want to set in the "Variable Value" field. At least that's where it is in 2k, but I'm pretty sure that I remember it being there in nt as well. ....or you could enter it in manually by bringing up the command prompt.
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

I've done what you suggested many times 4oh4, and some temp files go to what I 'set' them to, but others don't.
set temp=x:\temp
set tmp=x:\tmp
Where x: = a ramdrive.

I think we'd have to edit every key in the registry that points to c:\windows\temp in order to get every temp file where we want them.
Not worth the effort for me.
4oh4
Member
Posts: 46
Joined: Tue Jan 01, 2002 4:44 pm

Post by 4oh4 »

Well my guess would be that far more programmers make dumb assumptions then I had originally thought. ....not everyone installs windows to a dir called "windows" and not everyone uses a temp dir called "temp" under the "windows" dir either. This isn't the fault of windows though. It's ignorant programmers. God bless m$ for giving the kids tools like visual basic where they don't have to learn sound programming techniques in order to create applications eh? Editing all the keys in the registry that have anything to do with temp dirs isn't the answer. If it was though you could make short work of it with Registry Crawler (that program kicks ass btw). About the only thing you could do is patch the "c:\windows\temp" bull**** strings inside all the offending programs. -shrugs-
Post Reply