Sunday, March 11, 2012

Create symbolic links in Windows 7

I was running XAMPP on Windows 7 and tried to use symbolic link point to the folders with PHP code. The soft link created in Cygwin (ln -s <directory> <link-name>) did not seem to be recognized by Apache. I found  I need to use native Windows command in the command prompt.

Run Command Prompt as administrator
> MKLINK /D <link-name> <target directory>


I tried to use secpol.msc to grant myself with privilege for creating symbolic link.
secpol.msc via Start or Start → Run.
Open Security Settings → Local Policies → User Rights Assignment
It did not give me the permission to create symbolic link even after I re-log in. I have to run the command as administrator.

1 comment: