I'm trying to create a symbolic link between two directories. I have a directory called TestDocs and TestDocs2. I will be doing all my work in TestDocs, but I need it all to be reflected in TestDocs2. So all files that are in TestDocs2 will be replicated in TestDocs, and if I add a file, change a file, etc in TestDocs it should be reflected in TestDocs2.
So I thought it would be as simple as just doing this:
mklink /D TestDocs TestDocs2
But when I do that I get the error:
Cannot create a file when that file already exists
Why am I getting this?
Also, do I have the order of my TestDocs and TestDocs2 wrong in the command?
Thanks for the help, Symbolic Links have always confused me!
Press Windows key + R to open up a Run dialog box. Then, type ms-settings:windowsupdate and press Enter to open up the Windows Update tab inside the Settings app. Run dialog: ms-settings:windowsupdate. Inside the Windows Update screen, click on Check for updates and install every available pending update.
This is because you're trying to fake the existence of the Backup folder (so it must not exist already), but you also need its parents to exist. Windows will hence create a hard link shortcut Backup on the C:\ drive.
The error message "File Already Exists" or "File Already in Use" indicates that a file CTI Navigator Desktop is attempting to use is already open, locked or corrupted. The fix is to replace a corrupted file, and close, unlock or replace a locked file.
To delete a symbolic link, treat it like any other directory or file. If you created a symbolic link using the command shown above, move to the root directory since it is "\Docs" and use the rmdir command. If you created a symbolic link (<SYMLINK>) of a file, to delete a symbolic link use the del command.
The correct usage is:
MKLINK [options] {link} {target}
You're creating a link, so the link
is the new link you're about to create.
And the target
is the link's target, which is the existing directory.
Here is how that worked for me.
I wanted to relocate my C:\ProgramData\Package Cache
to F:
partition.
Steps I had to do:
Physically move "C:\ProgramData\Package Cache"
to F:
. Now I had "F:\ProgramData\Package Cache"
and "C:\ProgramData\Package Cache"
is gone since I moved it.
In cmd run (all in one line, split here for readability)
mklink /J "C:\ProgramData\Package Cache"
"F:\ProgramData\Package Cache"
Result:
Junction created for C:\ProgramData\Package Cache <<===>>
F:\ProgramData\Package Cache`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With