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

23 Sep 2015   #120
JerometheGiraff

Windows 10 Pro
 
 

GoKay -
Quote:
Create a symlink to the new location from the old one so any calls to the program gets re-directed to the new one seamlessly
What you mentioned is what I want to do; the target folder is simply an acronym of the source folder, but it still doesn't work ? Same error; cannot create a file when that file already exists.

Kado -
Quote:
I think your problem may be that the target folder already exists. I think if you are trying to create the junction C:/test/target then only c:/test can exist.
That doesn't explain why, if I give the target folder a name such as CPS, it still doesn't work ?

I may see the problem, the target folder is C:\Users\...\.. etc; but the source folder is C:\CustomFiles, is there a way to link despite the fact that the target folder has a different name ?


My System SpecsSystem Spec
.
23 Sep 2015   #121
GokAy

Windows 7 Ultimate x64 SP1
 
 

Then you have to move the folder (or delete old one after copy) to the new location, not copy alone. Then the symlink has to be created at the old location with the same name that directs to the new location (which can be same or different named).
My System SpecsSystem Spec
23 Sep 2015   #122
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

OK. Here is a worked example...

Prior to mklink

-2015-09-23-002.png

The command.

-2015-09-23-001.png

The result

-2015-09-23-003.png


My System SpecsSystem Spec
23 Sep 2015   #123
JerometheGiraff

Windows 10 Pro
 
 

Quote   Quote: Originally Posted by GokAy View Post
Then you have to move the folder (or delete old one after copy) to the new location, not copy alone. Then the symlink has to be created at the old location with the same name that directs to the new location (which can be same or different named).
I don't follow ?

If the target is at C:\Users\subfolder\subfolder\etc and the source is at C:\AcmeForever (example folder)

mklink /j <target> <source> doesn't work; neither does mklink /d <target> <source>
My System SpecsSystem Spec
.

23 Sep 2015   #124
JerometheGiraff

Windows 10 Pro
 
 

I can't link the main directory and have all sub-directories automatically link as well; I must create a symbolic link for the directory, including sub-directories ?

Target Directory: C:\users\<foldername>\<foldername>\<foldername>\<foldername>
Source C:\AcmeFiles\
My System SpecsSystem Spec
23 Sep 2015   #125
GokAy

Windows 7 Ultimate x64 SP1
 
 

Ok, I will try to be explicit:

I have some program at D:\programs\my_app
I want to move the folder "my_app" to another place (say to E) but keep my current shortcuts etc working
Then I would:
Move the folder my_app to E (so it is now at E:\my_app)
There is no my_app folder at the original location (D:\programs)
run the command:
Code:
mklink /d "D:\programs\my_app" "E:\my_app"
My System SpecsSystem Spec
23 Sep 2015   #126
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

That will work except /d gives a symbolic link /j a junction. They are similar in function.
My System SpecsSystem Spec
23 Sep 2015   #127
GokAy

Windows 7 Ultimate x64 SP1
 
 

I guess junction should be on the same partition?
My System SpecsSystem Spec
23 Sep 2015   #128
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

No it works across local drives. I've just tried it.
My System SpecsSystem Spec
01 Nov 2015   #129
Euclio

Windows 7 Professional x64 SP1
 
 
Moving C:\Users

Hi Kari, many thanks for the great tutorial. Is it a wise thing to move the whole c:\users folder to another local volume e.g. d:\users and make a directory junction in Win7 in order to relocate user data easily? Thank you.
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 19:23.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App