Having issues with creating a symbolic link - error says file exist

saberasus007

Honorable
Oct 26, 2013
9
0
10,510
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
 
Solution
That's a good question. Essentially they are two different things.

Applications such as Office, and Microsoft browsers store data in folders set by several strategies. You have environment variables, shell folders, symbolic links and junctions. I have never experienced any difference in behavior as to how they are accessed, so long as they exist. For example, Microsoft word will throw errors if the TEMP folder doesn't exist.

If you set the environment variables to nothing, and create a symbolic link for the temp variable word still throws errors. However, if the TEMP variable points to s symbolic link, word didn't care in the tests that I did. That suggests to me that the environment variable takes precedence.

Internet explorer uses...

Tanyac

Reputable
You have to physically MOVE c:\users\name\appdata\local\temp to E: drive FIRST.
Once the folder no longer exists on your C:\ you can then create the symbolic link.
The syntax of your mklink command is correct.

BUT.. And I see you are aware of the environment variables TEMP and TMP.

I have never ever come across a situation where anything ever needs to be "tricked" for these specific folders. Sure, I use symbolic links all the time (Like for MS Office MSOCache folder), but what programs expect them to be on the C:\ drive... I'd really like to know, so I can make sure I never use those programs, and I'm really curious because I've never seen this happen..



 

saberasus007

Honorable
Oct 26, 2013
9
0
10,510
That is the problem that is causing confusion. Do the system and user environmental variables over ride the symbolic link or do the symbolic link have 1st priority over those? Will the system take my symbolic link or will it ignore them if the user/system variables are different than the link. So am i doing a symbolic link and changing both user and system?
 

Tanyac

Reputable
That's a good question. Essentially they are two different things.

Applications such as Office, and Microsoft browsers store data in folders set by several strategies. You have environment variables, shell folders, symbolic links and junctions. I have never experienced any difference in behavior as to how they are accessed, so long as they exist. For example, Microsoft word will throw errors if the TEMP folder doesn't exist.

If you set the environment variables to nothing, and create a symbolic link for the temp variable word still throws errors. However, if the TEMP variable points to s symbolic link, word didn't care in the tests that I did. That suggests to me that the environment variable takes precedence.

Internet explorer uses a folder call iNetCache. This is specified in the shell folders in the registry. If that doesn't exist errors occur. Again, I specified a valid folder and created a symbolic link with that name to point to a different location. That works fine.

So what this suggests to me is that the environment variables and shell folders take precedence... They need to point to a valid location. That location can either be a real folder or a symbolic link to a folder. It doesn't matter.

Of course, there are some really badly written programs around. For example, Steam used to be fine with Symbolic links. In 2017 they changed the client and that broke symbolic link usage. As SSD prices used to be really high we put most popular games on the SSD, and all others on a HDD, then created a symbolic link in the SteamApps folder to point to the SSD. That worked fine, but as I said, Valve then changed steam (some say deliberately), so that symbolic links would no longer work, breaking those games.
 
Solution

saberasus007

Honorable
Oct 26, 2013
9
0
10,510
With Steam I know you no longer are limited to the directory or drive you put a steam game. Currently I have 5 Steam folders over 5 different drive letters/partitions. I do think there is a limit as to how many, I can't remember. I had no choice to branch out as the games are just getting so large, even for an install that you have no choice but to have to use HDD for most current AAA titles..