Set-up: Windows 10 64 bit, Anniversary Update. LyX 2.2.1.
Some time ago, I reported a problem with syncing LyX documents to various
computers, e.g., using OneDrive. The problem is as follows:
* On my job desktop, my user name is "berntl". On my job laptop, my user name
is "Bernt". On my private laptop, my user name is "Bernt Lie".
* I have stored my BibTeX file in a OneDrive folder, which is synced across the
PCs
* When I set up the BibTeX file on my desktop, the location is hard-coded to
"C:\Users\berntl\...".
* When trying to preview the LyX document on the laptops, I get an error
message because there is no directory "C:\Users\berntl\..." on them.
In my view, the best way around this would be to introduce a simple way to set
the path to the BibTeX file within LyX, i.e., it should not be part of the
document, but instead be part of the preferences set-up of the computer.
--
I discussed the possibility of *changing* the user name on my laptops with one
of our IT people, so that the BibTeX file would have the same physical address.
After some discussion, our IT expert suggested that I instead create a
*symbolic link* from user "berntl" to user "Bernt" (on my job laptop).
Essentially, this implies creating a new directory under "C:\Users" with name
"berntl", which contains links to the real files under "C:\Users\Bernt" --
without consuming disk space.
The following command in Command Window did the trick:
C:\WINDOWS\system32>mklink /D C:\Users\berntl "C:\Users\Bernt"
symbolic link created for C:\Users\berntl <<===>> C:\Users\Bernt
("mklink" makes the link, while "/D" specifies that it is a dynamic link).
Note: this command *creates* the directory "berntl", so directory "berntl" must
not exist on the laptops prior to running this command.
I still think it is better to have a preference set-up for the BibTeX file
directory, but for now this "hack" works.
-B