I use OneDrive to sync a script between multiple computers, including between my home and work machines. At work, we recently implemented separate logins for normal vs. admin access. This caused a problem because my script requires running under admin rights, but my admin account doesn't have access to my normal account's document folders where OneDrive syncs. I initially got around this by just manually copying the scripts between the sync location and one where the admin account can reach.
I next tried using a hardlink on my work computer, set up where the original file was in the sync location and the hardlinked version was in the outside folder. This worked great when I made changes to the script from my work machine, but I recently found that if I make changes on my home machine it breaks the hardlink. It seems that the process of OneDrive syncing the files works as a delete and re-add, so the delete step breaks the hardlink. The script continues to work because the "linked" file now becomes a standalone file.
Can anyone think of a way to keep these syncing, or a better way to do the same thing? I don't think there's a way to change the hardlink behavior because that seems to be integral to its design. OneDrive syncing a single file to a different location than the rest would be ideal, but I haven't found a way to do that.