Windows – Creating symlink for a file on Windows 7 gives error

symbolic-linkwindows 7

I want to create symlink to a file using the command prompt on Windows 7. The file is located on E partition and i want the link to be on C partition. I tried this command:
C:\>mklink /d c:\11.txt e:\Test\11.txt and it said that the symbolic link was created successfully but if i click on the link i get this error massage: 'The directory name is invalid'

What is the right way to create symlink for a file from different partition?

Best Answer

By using mklink /D you're telling it to create a directory symbolic link and D:\test\11.txt is not a directory. So if you try to access the directory C:\11.txt it will give you an error.

Just leave out the /D and it should work.

Related Question