Sunday, November 27, 2016

ln -s on Windows? Use mklink for symbolic links !

I needed to make Apache server seeing a folder via a symbolic link - on MS Windows. The standard Windows' shortcuts look like links, but Apache does not see them...

Apparently, there is a way to make REAL symbolic links under Windows. (Must run command prompt as administrator).

For example:

mklink C:\etc\hosts C:\Windows\System32\Drivers\etc\hosts

results in

C:\>dir c:\etc

2013-01-02  21:37    <DIR>          .
2013-01-02  21:37    <DIR>          ..
2013-01-02  21:37    <SYMLINK>      hosts [C:\Windows\System32\Drivers\etc\hosts]


The syntax for folders is:

mklink /D linkName target



Note: do not forget the drive letter (C:), or the link may not work in some situations.

Read more: