Symbolic links & Windows?

Psychor

Limp Gawd
Joined
Dec 22, 2007
Messages
388
On my home network I want to map \\server\share\Documents to C:\Users\User1\Documents for a variety of reasons.

(1) I renamed C:\Users\User1\Document to C:\Users\User1\Document.original
(2) I ran "MKLINK /D C:\Users\User1\Document \\server\share\Documents"
(3) I ran "DIR" to confirm that the symbolic link was created

Applications, which use the My Documents folder and sub-folders, seem to handle this setup just fine. However, when it comes to games, especially when running an installed for the first time, I sometimes hit an odd snag. In one situation when I ran a game for the first time the game reported an error that a folder couldn't be created (e.g., it wanted to make a folder in the My Document directory). In another situation running another game for the first time resulted in my symbolic link being deleted (e.g., I verified this by running "DIR" after closing the game). In both situations once the folder was created the games could read/write to them just fine.

I can bypass all of these issues if I remove the symbolic link, let the game use the local drive, move the game-created folder to the server folder and then recreate the symbolic link.

Questions:
(1) How exactly is a game deleting my symbolic link?
(2) Any idea as to why my symbolic link is not respected when games try to create an initial settings folders, etc.?


Thanks.
 
Last edited:
(2) Any idea as to why my symbolic link is not respected when games try to create an initial settings folders, etc.?[/color]Thanks.

Wild guess - the games are looking for the data files on the local disk.
Joys of copy protection software.
 
Wild guess - the games are looking for the data files on the local disk.
Joys of copy protection software.

I think you misunderstand. After the game folders/files are initially created locally and then moved to the remote share they're able to be accessed and modified from the remote share via the symbolic link. The issue is the first time said folders/files are created. See my post.
 
Now that I think about it I suppose that it could be some sort of credential/permission issue. Although the user on the client machine has local admin access and their credentials are mirrored on the server (e.g., they can create, deleted, etc. files/folders on the server). Perhaps the way the application is requesting the creation of a folder, file, etc. is via credentials/permissions other than those of the user? That being said why would the game not be able to create the initial file/folder but be allowed to create subsequent files/folders? Hopefully someone more knowledgeable can chime in. Granted, this doesn't explain the deletion of the symbolic link.

Thanks.
 
Some apps will actually check the path and realize the path where they are trying to create the folder isn't local, and will refuse to create the directory there. If they have properly written error handlers, you should get an error like "Cannot create non-local" folder, if they don't, you may get just a generic unable to create folder error.

Usually, that type of check is only performed at creation time, so if you select an existing folder, you don't run into that issue. Or you can replace the folder that was created with a linked path afterward, and it just checks to see if it exists without checking the path type, and all is well.

I had to do that with Amazon Unbox software to move the storage location from the tiny little drive I have on my HTPC, to the terabytes of space I have on my Windows Home server. It actually realized the path wasn't local and reported the correct non-local error.

As to your disappearing symlink, I don't know. Only thing I can think of is it used a browse window where you could select and delete the symlink and it happened accidentally (you can do this in the standard browse dialog). Just be glad it wasn't a junction. If it was a junction, you would have actually deleted the actual target as well...
 
Some apps will actually check the path and realize the path where they are trying to create the folder isn't local, and will refuse to create the directory there. If they have properly written error handlers, you should get an error like "Cannot create non-local" folder, if they don't, you may get just a generic unable to create folder error.

Usually, that type of check is only performed at creation time, so if you select an existing folder, you don't run into that issue. Or you can replace the folder that was created with a linked path afterward, and it just checks to see if it exists without checking the path type, and all is well.

I had to do that with Amazon Unbox software to move the storage location from the tiny little drive I have on my HTPC, to the terabytes of space I have on my Windows Home server. It actually realized the path wasn't local and reported the correct non-local error.

As to your disappearing symlink, I don't know. Only thing I can think of is it used a browse window where you could select and delete the symlink and it happened accidentally (you can do this in the standard browse dialog). Just be glad it wasn't a junction. If it was a junction, you would have actually deleted the actual target as well...

Excellent explanation, thanks! As to the last point... it definitely didn't open a browse window and the deletion occured sans any input from me. I thought it was very odd.
 
Back
Top