I’m running Windows 7 on one partition, and Windows 10 on another partition. I’m trying to use my Windows 7 hosts file in place of the Windows 10 one, since it has information in it used by XAMPP. That way I don’t have to keep two files up to date.

However, when I run this command:

mklink /D hosts D:\Windows\System32\drivers\etc\hosts

It’s made as a directory link instead of a file link. Is there a way to make Windows know that I’m linking files, and not folders?

  • “That way I don’t have to keep two files up to date.” Your short-term attempt at convenience will lead to headaches down the line. What? Unknown. But the second Windows 10 adjusts the hosts file in a way Windows 7 doesn’t like±—and visa versa—you might have one or maybe two damaged systems on your hands. – JakeGould Feb 9 '15 at 4:23
  • @JakeGould, Hasn't changed since XP, doubt it's going to change this run either. – David Feb 9 '15 at 4:28

You cannot hardlink a file across two file systems (e.g. C: and D:). You will need to use some kind of file synchronization program to keep the two files in sync, and you need to set it up on both OS.

You can create a directory junction, but it will link the entire folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.