Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible for me to create an ssh session on windows which then does some folder/file manipulation and then creates a NATIVE windows symlink.

i.e. a symlink that will be recognised by IIS and other app/services.

i've tried to create a symlink to a folder but all i get is a 1kb system file (with the same name) where the symlinked folder should be.

using ln -s SOURCE TARGET

i end up with target (system file, 1kb).

BUT in cygwin i can see the symlinked folder as normal.

share|improve this question
up vote 1 down vote accepted

Cygwin has its own symlink file format because native Windows symlinks don't have the right POSIX semantics. Worse, only administrators are allowed to create them.

If you do have administrator rights, cmd /c mklink can give you access to cmd.exe's builtin mklink command from a Cygwin session. Combine with cygpath to add POSIX path support, e.g.:

mklink() { cmd /c mklink "$(cygpath -w $1)" "$(cygpath -w $2)"; }
share|improve this answer
This unfortunately does not work in MinGW (e.g. the Git Bash Shell)... not just because of the cygpath bits but because the cmd /c just opens a CMD.EXE shell and leaves you there. Too bad, it's a clever trick! – iconoclast Sep 6 '13 at 21:42

Two years later, but I have the answer


The CYGWIN environment variable

share|improve this answer

What you are looking for is called a junction in the Windows world. You can find a tool in the Sysinternals suite from Microsoft to do that, more precisely:

I know it is possible with folders but I don't think it applies to files, moreover it is not possible to create juntions of remote shares.

share|improve this answer
yeah, i'm aware of making the mklink calls on windows. i've tried to use a bat file with that, but then you get in to path issues etc. where unix style paths are different. it all starts to get messy. was hoping i could just make a call to cygwin and it translate that to a native symlink – mickdelaney Sep 24 '10 at 15:05
This kind of links are implemented at file system level so you are tight to what, in your case probably NTFS, is offering. – Cristian T Sep 24 '10 at 15:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.