Update symlinks after moving target folder


  1. Posts : 4
    Windows 10
       #1

    Update symlinks after moving target folder


    Hi,
    I'm a photographer who recently started using symlinks to classify my photos into categories (read folders) on my windows 10 laptop. The target RAW files stay in folders on a removable HDD. Issue: I need to move the target folders a little (one step up or down the tree), and rename one of them. The filenames remain unchanged. Is there any program or utility out there which will allow me to change the symlink targets to point to the new locations, in batches, without me having to delete all the dead symlinks and create them again? Basically update the links the symlinks point to?
    Thanks
      My Computer


  2. Posts : 1,680
    X
       #2

    I suspect that Windows can handle this automatically ...

    SETUP
    I created a folder on the desktop called "m" for master, and I put a file there called "f.txt".
    I created a shortcut on the desktop that references that "f.txt" file.
    So ... the shortcut references "C:\Users\<user>\Desktop\m\f.txt"

    TESTING
    With Windows Explorer ...
    I created a new folder on the desktop called "new".
    I moved the "m" master folder into the "new" folder.
    The desktop shortcut still works!
    It now references "C:\Users\<user>\Desktop\new\m\f.txt"
    Perfect!

    Then I renamed the "m" folder to "n".
    Once again the desktop shortcut works.
    It now references "C:\Users\<user>\Desktop\new\n\f.txt"
    Perfect!

    All of this works because the moving and renaming was done with Windows Explorer.
    I'm pretty sure it will NOT work from a console command prompt.

    OPEN QUESTION
    This works properly for the internal C: drive.
    Will it work with an external drive? I don't know.
    Do a simple test ... just a couple of files ... and see if it works.
    Last edited by margrave55; 19 Nov 2017 at 16:08.
      My Computer


  3. Posts : 4
    Windows 10
    Thread Starter
       #3

    Thanks @margrave55

    To check, I moved two files into their parent folder and tried accessing them again using the symlinks. Didn't work. No error message, but the files didn't open either. Basically nothing happened. I moved the files back again, and the symlinks worked once more.

    Did you create symlinks or shortcuts? I suspect shortcuts would update the paths themselves, but symlinks wont. Not sure about the difference between an external drive vs the internal drive, but my files need to be on an external HDD.
      My Computer


  4. Posts : 63
    Windows
       #4

    Margrave used shortcuts, which are useless for your (and just about any other non-trivial) purpose.
    For non-trivial symlink handling I would highly recommend you get yourself Schinagl's link shell extension, pretty much the gold standard for this kind of work.
      My Computer


  5. Posts : 4
    Windows 10
    Thread Starter
       #5

    Thanks Pirx,

    The symlinks were made using link shell extension, and work just fine. There's no provision for moving the target files around, though (at least from what I understand).
      My Computer


  6. Posts : 63
    Windows
       #6

    You are creating symlinks to folders, right? The way I understand your scenario at least there's no good reason to directly symlink individual files, anyway. If you do use symlinks to folders you would be able move around the files within the linked folders in any way you like. Link shell extension can also create a number of more spiffy link constructs (like a "Delorean copy" and similar stuff), but I have never used those. It's possible that one of these better matches your use case, so you could look into these as well.
      My Computer


  7. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #7

    Don't know if this is what you are looking for. Use right click context menu to update links

    For 64 bit Windows: http://download.microsoft.com/downlo...redist_x64.EXE
    For 32 bit Windows: http://download.microsoft.com/downlo...redist_x86.EXE

    Install one of the above then install Link Shell Extension:
    Download: Link Shell Extension

    Open file explorer for both source and destination side by side. Delete all old links then use drag and drop as shown below:

    Update symlinks after moving target folder-p1.jpg
    Update symlinks after moving target folder-p2.jpg
    Update symlinks after moving target folder-p3.jpg
    Last edited by topgundcp; 17 Nov 2017 at 01:58.
      My Computer


  8. Posts : 4
    Windows 10
    Thread Starter
       #8

    @Pirx I've actually linked to files rather than folders. Of all the options available in link shell extension, I thought this was the simplest and easiest for my case . Guess not.
    The setup: I place the original files in folders according to the date and place of shoot on the HDD, and place them in folders with symlinks to the original files on my internal SSD using a theme based classification (e.g. all the shots of Elephants in one folder, Giraffes in another one etc.). Organizing these files have taken me weeks, and I now wish to move the target folders around just a wee bit. There should have been no need, but I made a mistake in the name with two folders containing thousands of files each. @topgundcp I already have this installed
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:33.
Find Us




Windows 10 Forums