Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: MKLINK Create and Use Links in Windows

10 Jul 2015   #80
Kari

Microsoft Community Contributor Award Recipient

 

Quote   Quote: Originally Posted by Pyprohly View Post
Quote   Quote: Originally Posted by Kari View Post
Your mklink command has no switches, meaning that Windows thinks it is a symbolic link (a folder).
Slight mistake there, Kari.
Could you please explain my mistake?


My System SpecsSystem Spec
.
10 Jul 2015   #81
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
Quote   Quote: Originally Posted by Kari View Post
Your mklink command has no switches, meaning that Windows thinks it is a symbolic link (a folder).
Slight mistake there, Kari.
Yes. Without any switches it is a file symbolic link. https://technet.microsoft.com/en-gb/.../cc753194.aspx
My System SpecsSystem Spec
10 Jul 2015   #82
Kari

Microsoft Community Contributor Award Recipient

 

I stand corrected, begging you geeks to forgive me. My point was and is that I see no reason to use symbolic links to anything else than folders. With a file it's always better to use a hard link. Of course if you can tell a reason why you should use a symlink instead of hard link?

Anyway, as I am apologizing a bad choice of words, I am at the same time amused that no one could spot that the OP had the link and the target switched. The OP has now been given a working command.
My System SpecsSystem Spec
10 Jul 2015   #83
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

A Symlink can be used across volumes a hard link can't.
My System SpecsSystem Spec
.

10 Jul 2015   #84
Kari

Microsoft Community Contributor Award Recipient

 

OK, again I stand corrected. That's true and a reason good enough to use it if the link and the target are on different volumes.
My System SpecsSystem Spec
10 Jul 2015   #85
JerometheGiraff

Windows 10 Pro
 
 

Wait, maybe I forgot to mention something, I want to make a hard like from a file to a directory same command ?

mklink /h <absolute path of the file> <absolute path of the target directory> ?
My System SpecsSystem Spec
10 Jul 2015   #86
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

mklink /h <path to link name> <path to real file>

I think.
My System SpecsSystem Spec
10 Jul 2015   #87
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by Kari View Post
I see no reason to use symbolic links to anything else than folders. With a file it's always better to use a hard link. Of course if you can tell a reason why you should use a symlink instead of hard link?
Yes, I can list three, three of the biggest reasons why one would fancy a symbolic link over a hard link: (in decreasing order of interest)
  • Symbolic links are the only links that support relative paths as targets;
  • Symbolic links can link across partitions, unlike hard links which cannot;
  • Symbolic links can point to a non-existent target (mega useful if you want to allow the target's data to change whenever, without having to re-create the link).
Kari, I feel that hard links and junctions are obscuring the power of symbolic links in this tutorial of yours. Symbolic links should really be the type of link in the lime light; symbolic links should be the links that deserve to be demonstrated in a tutorial.

With all due respect, I strongly recommend that you add a table to the tutorial, Kari, one that summaries the benefits and disadvantages of the types of links: what links have support for files/folders?; what version of Windows is the link supported in?; can I link across hard disks using this link?. Certain links are simply better for certain situations, there's no denying that.


Quote   Quote: Originally Posted by Kari View Post
I am at the same time amused that no one could spot that the OP had the link and the target switched. The OP has now been given a working command.
Are you referring to Jerome's command line:
Code:
C:\Windows>mklink C:\Users\....\....\....\....\.....\...\<individual file> C:\1
If so, maybe we did, maybe we didn't spot that. In any case, you could not have concluded that "C:\Users\....\....\....\....\.....\...\<individual file>" was Jerome's intended target and "C:\1" was where his link should be created. Facing it, there are many things wrong with "mklink C:\Users\....\....\....\....\.....\...\<individual file> C:\1" that it just wouldn't be in good interest to help 'OP' at this stage, until 'OP' can clarify his objective.


Quote   Quote: Originally Posted by JerometheGiraff View Post
Wait, maybe I forgot to mention something, I want to make a hard like from a file to a directory same command ?

mklink /h <absolute path of the file> <absolute path of the target directory> ?
No. Hard links have no support for folders. You must use a symbolic link or junction point instead.
My System SpecsSystem Spec
10 Jul 2015   #88
GokAy

Windows 7 Ultimate x64 SP1
 
 

Just wanted to add: Symbolic links turn into normal folders with copies of contents of the linked folder when copied to another place. Is there a way to avoid this? Learned this while we had a discussion in a thread recently.
My System SpecsSystem Spec
10 Jul 2015   #89
JerometheGiraff

Windows 10 Pro
 
 

I'm going to reiterate. I want to create a symbolic link whereas I create a symbolic link to a file, when the file in the symbolic link location gets updated, or the original location, either way both files get updated. In laymen terms, the file in the original location gets cloned; when I save the file in the cloned location, both the cloned file and the location of the original file get updated.

It has been informed that I must use a symbolic link for what I want to do personally;

mklink /d <absolute path of source location FILE> <absolute path of target location DIRECTORY\FOLDER>

The above command is not working ?
My System SpecsSystem Spec
Comment

 MKLINK Create and Use Links in Windows




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




Similar help and support threads
Windows 7 Tutorial Category
MKLINK, HIBERFIL.SYS amd SSD space
I have two drives, an SSD for the OS (C:) and a platter drive for data (D:). I want to be able to hibernate my PC but don't want HIBERFIL to wear out my SSD as I have lots of memory (24GB) being written to the SSD every time I hibernate. Can anyone please advise me whether it's possible to move...
General Discussion
MKLINK - Can not create what is already there
Not correct sentence but it is original in Swedish. Because i am not a fan of printscreen, so i will post what i have written: C:\Windows\system32>mklink /d "C:\Users\Susanne\AppData\Local\Opera Software\Ope ra Stable" "E:\" I am not really shure about the differens between "j" and "d",...
General Discussion
Create Skydrive share links within file explorer
I'm using skydrive often and I really like it. I also Like the Feature that I can send a link to my friends so that they can download the file. Unfortunately I always need to login on the Web Interface to create the link - with a lot of clicks. Is there a way to create this link directly from...
Software
Links Library - Create
How to Create a "Links" Library with Correct Icon in Windows 7 and Windows 8 This will show you how to create a Links library that has the correct Links folder icon on a glass plate for it's library icon in Windows 7 and Windows 8. The included folder C:\Users\(user-name)\Links is also the...
Tutorials
How to create my own folder links in the Start Menu
On the right hand side you have buttons (User, Pictures, Music, Video,etc) that I don't want/use. Would like to change some of these for my needs. Played around with it a bit but without luck. How do I do this?
Customization


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:08.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App