# Change default TEMP folder location



## aewarnick (Sep 3, 2002)

I have a partitioned hard drive. Now the temp is in c:
I would like to have windows recognize the temp folder as being in d: instead of c: because c: does not have enouph room to hold some temp files.
Can I do that?


----------



## pvc9 (Jul 7, 2002)

Few weeks ago, I guess it was _ilusha2_ who posted about moving the Favorites folder to a different location and *Mosaic1* suggested the member to move the folder directly in Explorer and that the changes would be made to the registry dynamically!

All I want to say now is that, I've tried what Mo posted then and its working very well for me, no problems at all. So move the Temp folder manually, do a restart and everything should be fine!

Check that and post back!


----------



## aewarnick (Sep 3, 2002)

I already deleted the temp folder in c:windows. Is that a problem and which program or what can I do to check to see if it changed in the registry. In other words, how can I get the computer to write to the temp folder?


----------



## patch-man (Oct 8, 2002)

Edit your c:\autoexec.bat. If there is a line in there similar to "set temp= ..." modify that, otherwise add one. Simply "set temp=d:\temp" will work (make sure that you have created d:\temp).


----------



## pvc9 (Jul 7, 2002)

I dont think the settings in the autoexec.bat file would've any effect on the windows registry!

When did you delete the Temp folder? As a matter of fact, I deleted the Temp folder too(by mistake) and I recreated it manually just the new folder and ..., I've no problems at all!

But, simply create a folder, Temp as you want to and then use it to store the Temp files and that shouldnt cause any problems!


----------



## aewarnick (Sep 3, 2002)

I tried editing the autoexec but I don't know how to stimulate the computer to use the temp folder to test it.


----------



## pvc9 (Jul 7, 2002)

On other thoughts, you better create a Temp folder in the C:\Windows rather than the other drive!

If you've any files likes, documents, pictures, movies and other such files, move them to the other drive and dont change the location of the Temp folder!

There are a lot of programs' settings in the registry that you've to change for the programs to run without any errors!

So IMHO, move any stand-alone files to other drive and leave the C:\Windows\Temp folder as it is


----------



## aewarnick (Sep 3, 2002)

Thank you for your help.
It is too bad I have to leave the temp in c:


----------



## pvc9 (Jul 7, 2002)

You're welcome!

But dont you have any files that you can move to the other drive? Just curious!


----------



## aewarnick (Sep 3, 2002)

I figuered I would only need about 1 gigabite for windows. I partitioned my drive c:1 d:13.5.
All I have on c: is what windows installed and one other small program.

I have already had to delete files from the temp folder that took up about 500 megs. That is why I wanted to change the location of it.


----------



## pvc9 (Jul 7, 2002)

What??? 500/1024 MB for the Temp folder??? Were you storing any files there or how did that much data get into that folder?

BTW, you must be knowing this but NONE of the files in the Temp folder are actually needed by Windows! It can/should be cleared regularly!


----------



## aewarnick (Sep 3, 2002)

I think my cd burning program did it.
I wasn't sure if I could delete all the files in temp or not (I did anyway) but thanks for the insight. Now I know for sure.

Can I set up a scheduled task or something to delete everything everyday?


----------



## pvc9 (Jul 7, 2002)

Np

Best way would be to delete the files manually! Just before you shutdown the computer or just when you start it you can delete them manually!

But, if you really want to do it in a different way, then there was a thread here recently about a batch file and deleting the contents of the Temp folder. So will look for that and will post if needed!


----------



## aewarnick (Sep 3, 2002)

If there is another way instead of manually deleting them I would like to go that route.


----------



## pvc9 (Jul 7, 2002)

Ok!

Check this link and everything will be clear -

http://forums.techguy.org/showthread.php?s=&threadid=96135


----------



## aewarnick (Sep 3, 2002)

I think I've got it! I'll try it out. Thanks alot.
If it doesn't work I'll get back to you.


----------



## pvc9 (Jul 7, 2002)

Good!

You can post back anytime if at all you need any info!


----------



## aewarnick (Sep 3, 2002)

1.Open Notepad. In a new file, type:
DELTREE /Y C:\WINDOWS\TEMP\*.* > NUL
EXIT

2. Go to File, Save As. Name it "FileName.bat" WITH the quotes surrounding the name.

3.This will create the batch file. Now you can exit notepad. Right click the .bat file you have just made. Go to Properties and the Program tab. Check (tick) close on exit.


Why do I have to do step 2 like that? I just changed the .txt to .bat. Won't that be the same thing?

Also, I tried not putting the quotes arount filename.bat and it did the same exact thing as with the quotes.


----------



## pvc9 (Jul 7, 2002)

Do this and it should work out -

Open Notepad, copy and paste this line,

*DELTREE /Y C:\WINDOWS\TEMP\*.* > NUL*

Click on Save, name it whatever, may be _DelTemp.bat_, you need to save it as *bat* instead of txt.

After that, double click on that and that should take care of all the files in the Temp folder!


----------



## WhitPhil (Oct 4, 2000)

Changing the TEMP setting(s) in Autoexec will move your temp files.

*Set Temp=D:\Temp
Set Tmp=D:\Temp*

Then create the folder *Temp* on the D: partition.


----------

