Solved! How to create symbolic link for windows temp folder

saberasus007

Junior Member
Oct 26, 2013
15
0
66
#1
Having problem with symbolic links. I have read so many pages I still don't understand why it isn't working on my system.

DETAILS ON SETUP:
Configuration:
Windows 7 64bit Service Pack 1, Drivers and .net software, no other apps or programs installed
Core i7-6700K on a Z170 motherboard
Drive 1 SSD 500GB
Drive 2 HDD 4TB
Both are setup as GPT and 1 partition each, with the remaining space not used or in saved space for over-provisioning of SSD.

SSD is primary boot drive and has the partition of C:\ where windows 7 is installed
HDD is secondary and contains a partition of only 150GB (e:) for now, will change later when ready to use it for games.

Neither drive partition is greater than 2tb.

where name is my real name

I want to move the c:\users\name\appdata\local\temp to e:\users\name\appdata\local\temp

I have tried all combinations but this is the one I am still sticking with

Mklink /D "c:\users\name\appdata\local\temp" "e:\users\name\appdata\local\temp"

e: partition has no directories and no files on it, cleanly formatted. Factory new.

I used the switch /D since I want it to be just a symbolic link and not a hard or junction point symbolic link. I will not be setting this drive to work with remote programs in terms of using/installing anything.

PROBLEM:

Everytime I type that mklink command above, I get the same message:

Cannot create a file when that file already exists

I am aware that you can change the temp and tmp environmental settings in advanced settings which is divided up into User and System Variables. However they do not provide a symbolic link that programs that expect those 2 folders to be on the system drive can be tricked into accepting the new location.

Please I have already spent 5 hours on this issue (try to solve before posting).

Be of great Help for Solution.

Saberasus007
 

saberasus007

Junior Member
Oct 26, 2013
15
0
66
#3
I think you have it on reverse. Based on the documentation the link should come first then the target.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

mklink /d "e:\users\name\appdata\local\temp" "c:\users\name\appdata\local\temp"
First off I want to thank you for your assistance and suggestions above. The problem is that many websites seem to say starting location and target. Which is why I figured after all the time spent, I need to go to tech support beyond my abilities.

A second question/followup, is there a need to change the environmental Variables (right click on desktop icon, properties, select advanced system settings, select advanced tab, it will be preceded by "User Profiles", and that is the button Environmental Var. clicking on it you now have 2 panes (window/glass - a full windows cut in two) The first window says:
"User variables for MyName

It has a temp and tmp in it. Then if you go to the window under the title (or bottom half) System Variables which also includes temp and tmp of course these last 2 point to c:\windows\temp and unlike the previous one where it was users\myname\appdata\local\temp. I haven't exactly figured if these are effected

Thanks again!
 

mxnerd

Diamond Member
Jul 6, 2007
4,460
146
126
#4
You should change user's environment or system's TEMP & TMP variables, not creating symbolic links.

Don't have to worry about that %User Profiles% variable.

You can change the TEMP and TMP directories to anywhere your want.

Of course you have to create those directories yourself.
 

saberasus007

Junior Member
Oct 26, 2013
15
0
66
#5
I had wondered about whether both environmental variables and symbolic would interfere with each other. So I should change the user and system settings not just user?
 

mxnerd

Diamond Member
Jul 6, 2007
4,460
146
126
#6
Symbolic link is a virtual thing. It just create another pointer which points to the same place. It's like you place another post 2 blocks away that points to your house. You don't suddenly have 2 houses magically.

It has nothing to do what you want to achieve.

Changing the TMP & TEMP variables to another folder/drive just tell the system or current user account where to store the temporary files/garbage and that is exactly what you want.
 

saberasus007

Junior Member
Oct 26, 2013
15
0
66
#7
Thanks but I still don't know if I am to change the system environmental variables as well. Since below the user is system variables which list temp and tmp to c:\windows\temp. Will those need to be changed as well as the user or will the user override the system.

I would assume the System is also tied to a user account or is the dominant part of the environmental variables. So I have no guest accounts, I have only one account, with my name as the admin and I don't sign in/use passwords or anything I just boot into Windows (no fear of anyone in household trying to access my computer, meaning prying eyes or accessing illegally from the client/user - my computer chair). So I will change the user variables and hold off till I have heard from you or anyone in this thread about the system variables that are under the user variables.
 

mxnerd

Diamond Member
Jul 6, 2007
4,460
146
126
#8
System TEMP & TMP variables only control system processes, it does not tied to any user's account.

User TEMP& TMP control user processes (user launched application) where to create temporary files.
 

mxnerd

Diamond Member
Jul 6, 2007
4,460
146
126
#10
Either System or user TEMP & TMP can be changed to wherever you like.

If you point them to HDD's folders, it slows you down a bit when creating & reading temporary files, but also will extend your bootup SSD's life.
 

Similar threads



ASK THE COMMUNITY

TRENDING THREADS