1

I have some files that I need for multiple projects.
I need changes made to them to be applied in directories of each projects.
Copy pasting them all the time is unpractical and I could forget to do it sometimes. So I need a way around this.

Also is there a way to do this for folders as well?

zoran404
  • 205

3 Answers3

1

You can use simbolic links. Open cmd (Windows + R, then type "cmd", enter) and navigate to the directory where do you want to have your files (use cd for that). Then type mklink <link_name> <path_where_you_have_your_original_files>.

You can do this for directories too, but add the switch /D in the above command.

redbeam_
  • 537
1

You can indeed. mklink.exe is your friend here.

It sounds like you want to create hard links for your files in all of your projects, so you would start with one of the files and create hard links to the other directories. At this point, all of the file names will be pointing at the same chunk of data. You could create symlinks as well, but I think a hard link fits your model better.

mklink /h linkname targetpath

You can also use it to create directory links, which will behave slightly differently as there will be one real directory, and the links will point to it.

mklink /d linkname targetpath

Further details at What are the various link types in Windows? How do I create them?

dsolimano
  • 2,906
0

I up-voted your answers but I just want to add some tips I found for whoever visits this question:

First go to the folder where you want to create the link, then press Shift + Right Mouse button in the folder (this opens the extended menu) and select "Open command window here"

In command window type:

mklink /h newLinkName pathToOriginal

Similar goes for directories:

mklink /d newLinkName pathToOriginal

Btw instead of typing the path to the original file you can just drag and drop it into the console.

zoran404
  • 205