9

I made some symlinks in MS Windows using mklink /D command. But when copy it, Windows Explorer always perform deep copy instead copying symlink itself. How can I just copy the link? I need to send these links to other users on other machine.

3
  • I've downvoted the OP to reconsider the correct answer again, and because there are other answers on SU.
    – M. A.
    Commented Dec 14, 2019 at 10:15
  • @M.A. I deselected the answer and I cannot chose one now as I cannot test answers below anymore. Let's see which one to be chosen by community!
    – Eonil
    Commented Jan 8, 2021 at 4:09
  • Does this answer your question? Windows 7 / Symlinks - How do I copy a Symlink to a directory?
    – Basj
    Commented Feb 2, 2021 at 9:05

5 Answers 5

4

A tool answer: LinkShellExtension allows you to do this and much more. If you're working with soft/hard links in Windows at all, it's an enormously helpful tool.

In this case, you probably want to choose its 'Splice' behaviour in copying Symlinks.

1
4

partially duplicate question, multiple good answers are here

Using Windows tool

xcopy /b /i <source symlink name> <destination symlink name>

and you should disregard a message:

output is 0 File(s) copied

also another tool in standard Windows installation: robocopy

/SL :: copy symbolic links versus the target.

Since you mentioned you want to "send" it, you might get TAR which can pack/unpack symlinks into one archive file. 7z might one day too.
As I see it, 7zip can archive them but not extract on Windows.

2

The symlink to a directory acts as a directory itself. So, when you copy the directory, you copy the directory.

If you had a directory with a bunch of files in it and you wanted a copy of it, but without the files in it, you'd just make a new directory with the same name. Same thing applies here, really.

-1

The answer is as simple as that: You cannot. Instead, run the same command on the other machine.

3
  • 5
    This is wrong as indicated here Commented Mar 9, 2017 at 15:29
  • This is not the correct answer, and I downvote
    – M. A.
    Commented Dec 14, 2019 at 10:13
  • This is correct in the context of using Windows Explorer, as mentioned by OP. Indeed, it seems to be impossible with the Windows Explorer GUI. With command-line, it is possible with xcopy as mentioned by @AntonKrouglov.
    – Basj
    Commented Jan 7, 2021 at 8:21
-2

Just drag and drop the symlinks between one explorer window to their destination in another. It will move them without copy the contents.

1
  • Not working for relative folder symlinks. Commented Mar 9, 2017 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .