1

I've read a lot of about symlinks (symlink, junction, hardlink, etc.) and download a few software to create symlinks (symlink creator, link shell extension) but I can't create a symlink that acts as the original Documents and Settings folder!

So, in total commander, when i open the 'D&S' dir the path change to c:\Users\ but when i do this with my own created symlink it's just not work in this way: "c:\test\mylink" <==> c:\test2\destination\ and a path is: c:\test\mylink\ but with the destination folder's files and folders in it! I hope I've described my problem understandably :) !

Thanks in advance!

ps:
i'v tried the following cmd commands:
- mklink c:\test c:\test2 (works)
- mklink /d c:\test1 c:\test2 (works)
- mklink /j c:\test1 c:\test2 (works)
- mklink /h c:\test1 c:\test2 (this not works and returns "access denied" as it only works with files)

An example:
- i have this existing folder: c:\test2\
- there's a readme.txt file in it
- write this in cmd: mklink /d c:\test1 c:\test2
- it creates the link named test1 and when i open it i see the readme.txt BUT the PATH is "c:\test1" NOT "c:\test2" which i want to!

erkage
  • 110
  • 3
  • 14
  • What version of windows are you using? Do you want to make "Documents and Settings" point to a different directory, *or* do you want to make a new directory point to your "Documents and Settings"? Also: please edit your post and add any mklink commands that you've already tried, and the output from those commands. – pb2q May 21 '12 at 21:15
  • Sorry, I can't understand what you are trying to do or what is going wrong. Please try to explain more clearly. – Harry Johnston May 21 '12 at 21:20
  • windows 7 x64! Neither! i want to create a new link somewhere point to for example: c:\test\ but the way as the Document and Settings work (so the path is also change)! – erkage May 21 '12 at 21:24
  • So: you want Total Commander to open c:\test2 (and show that as the path) when you click on c:\test1? That's really a question about Total Commander, not about symlinks. – Harry Johnston May 21 '12 at 21:39
  • Incidentally, why not use a shortcut instead? – Harry Johnston May 22 '12 at 03:35

3 Answers3

3

Please follow this post: http://www.ohmancorp.com/RefWin-Win2008R2-AltProfilesFixJuctions.asp

Sample code for the "My Documents\Music" junction:

mklink /J "My Music" "C:\Users\jozjan\Music"
icacls "My Music" /deny everyone:(RD) /L
icacls "My Music" /setowner SYSTEM /L
attrib +S +H +I "My Music" /L

You can check using the "dir /al /s C:\Users\Default" which juctions must be recreated by default. There is a script on the link above which can help us well.

jozjan
  • 739
  • 5
  • 5
1

OK, you want to replicate the same conditions as the Documents and Settings. Start by using a junction point:

 mklink /J c:\test3 c:\test2

Make it system and hidden:

 attrib +H +S c:\test3

Then change the permissions:

 icacls c:\test3 /deny *S-1-1-0:(S,RD)

If this doesn't work, it is likely that Total Commander treats Documents and Settings as a special case. If the vendor has a support forum, you could ask about it there. There might be some way to configure it to do the same thing for other folders.

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
  • Yes, that's exactly what i want! But at the third step it return this: Everyone: No mapping between account names and security IDs was done. successfull 0; failed 1 – erkage May 21 '12 at 21:57
  • I'm guessing the icacls command didn't work because you are running a localized (non-English) version of Windows. I've updated my answer to use a different command which should work, so try again. – Harry Johnston May 22 '12 at 01:18
-2

Windows does not have symlinks or hardlinks. It has shortcuts, which are sort of like symlinks. You are, I'm afraid, out of luck.

Edit:

As has been pointed out to me, windows does support symlinks. See the comments for details. However, for what you are doing, you are missing the point of a symlink.

Think of a directory as a bucket. You have lots of these. Each of them has a name on the side of the bucket and other buckets have slips of paper with those names. The slips of paper are not the buckets. They just have a name of a bucket on them.

Since that is the case, you could write any name on the front of the paper and the real name on the back. Total commander reports the name on the front of the slip of paper that it is currently using, which may or may not be the actual name. But, it points you to the bucket with the real name.

For what you want, just create a symlink with the same name as the location you want, just so long as they don't have the same parent folder, it will be fine.

Good:
mklink /D c:\stuff\test2 c:\test2

Bad:
mklink /D c:\test2 c:\test2
Spencer Rathbun
  • 14,510
  • 6
  • 54
  • 73
  • It has! it debutes in Vista! [link](http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/) – erkage May 21 '12 at 21:06
  • In fact, NTFS - since Vista, I believe - _does_ support filesystem operations that are mostly like symlinks. Are you familiar with the _mklink_ command? Unlike _shortcuts_ these are not just regular files on the filesystem containing a path. See also: [NTFS Junction Points](http://en.wikipedia.org/wiki/NTFS_junction_point). – pb2q May 21 '12 at 21:06
  • yes i'am! i've tried mklink with all options (/d /h /j) but nothing creates a link as the D&S folder work! – erkage May 21 '12 at 21:09
  • @pb2q Well that is good to know. Back when I first ran into this I couldn't find anything to do links. I was on XP though, and I needed to link to a file which Junction points do not support. There isn't a one to one correspondence. – Spencer Rathbun May 22 '12 at 12:35
  • @RKG yay windows! You've added a feature everyone else had for a decade :) – Spencer Rathbun May 22 '12 at 12:37