Utility ~ Windows Directory Junctions

Description

The Windows Directory Junctions allow you to create "hard links" (which come in several flavours including junctions) between folders, similar (but different to) the shortcuts to programs you add on your desktop. It will work with Windows Vista or Windows 7 or above, where your hard drive is formatted in NTFS Version 5. It may also work with Windows 2000 or Windows XP with the Windows Resource Kit Tools or Windows Sysinternals Junction installed.

Its main use with Family Historian is to link folders within the Family Historian Program Data Folder or the Family Historian Projects folder into another folder, such as your Documents folder, or Dropbox folder, or OneDrive folder.

:!: This is for advanced PC users only. :!:

Installation & Download

None required as the MKLINK command exists within the Accessories » Command Prompt utility, or in Windows 10 the right-click Start » Command Prompt utility.

See MKLINK Command and MKLINK - <JUNCTION> vs <SYMLINKD> for more details.

Configuration Guide

What this software lets you do is link any actual folder to another location of your choice, such as a folder within My Documents or Dropbox or OneDrive, such that the folder appears to be in two places.

Perform the following steps after the "{Link Folder Path}" exists except for the final folder name, but not while Dropbox or OneDrive is synchronising.

  1. Use Start » All Programs » Accessories » Command Prompt and maybe right-click Run as administrator.
    In Windows 10 use right-click Start » Command Prompt or maybe Start » Command Prompt (Admin).
  2. Enter command MKLINK /J "{Link Folder Path}" "{Target Folder Path}"
    • e.g. MKLINK /J "C:\Users\Mike\OneDrive\Project" "C:\Users\Mike\Documents\Family Historian Projects\Project"
  3. Repeat for any other folders.
  4. Enter Exit command.

This will mean that your Project folder is now linked into Dropbox or OneDrive and should be kept in synch. If you are using two computers with Dropbox or similar, you will need to replicate the folder links on the other PC as above.

You may repeat these steps for any folder within the Family Historian Program Data Folder.

The Utility ~ Link Shell Extension can also create these links by using Pick Link Source followed by Drop As… » Junction.

Dropbox Exception

Unfortunately, Dropbox does not support Directory Junctions or similar links in this direction. The workaround is to reverse the direction of the Directory Junctions by moving each folder into the Dropbox folder and creating the Directory Junction in the original folder location.

N.B. Upgrading Family Historian may break these links and you may need to rebuild them using steps 1 to 4 again after deleting the ones which the install creates.

OneDrive Exception

Unfortunately, OneDrive does not fully support Directory Junctions or similar links in this direction. Initially the files in a new Junction Folder are synchronised, but thereafter when any files are updated or added they are not uploaded to the OneDrive online store until some other change triggers a scan for unsynchronised files. However, files updated in the OneDrive online store are downloaded to any Junction Folder. Microsoft is aware of the problem and a fix may appear in due course.

There are a number of workarounds.

  1. Reverse the direction of the Directory Junctions by moving each folder into the OneDrive folder and creating the Directory Junction in the original folder location. Upgrading Family Historian may break these links and you may need to rebuild them using steps 1 to 4 again after deleting the ones which the install creates.
  2. Occasionally stop and restart the OneDrive program, or logout & login, whereupon it will scan all the folders and synchronise any unsynchronised files.
  3. Use the Task Scheduler to repeatedly run a Visual Basic Script that renames a file in the OneDrive root folder. This triggers OneDrive to scan all the folders and synchronise any unsynchronised files. e.g. SYNCH.VBS script file containing:
    Dim FSO
    Set FSO = CreateObject("Scripting.FileSystemObject")
    FileA = "SYNCA.TXT"
    FileB = "SYNCB.TXT"
    If FSO.FileExists(FileA) Then
       FSO.MoveFile FileA, FileB
    ElseIf FSO.FileExists(FileB) Then
       FSO.MoveFile FileB, FileA
    Else
       FSO.CreateTextFile(FileA)
    End If