Relative path shortcuts help


  1. Posts : 52
    Windows 7 Home 64bit
       #1

    Relative path shortcuts help


    Hello.

    I have a large number of folders and shortcuts on an external drive.
    Example:
    Folder 1
    - Folder A
    - Folder B
    Folder 2
    - Folder A
    - Folder B
    Folder 3
    - Folder A
    - Folder B

    To create a shortcut from Folder 1A to Folder 3B I'd need to go <Drive>\Folder 3\Folder B however since it's an external drive and the drive letting will most likely change depending which computer it's connected to absolutes wont work.

    I know it's possible to use %windir%\explorer.exe "..\..\Folder 3\Folder A" but that opens a new explorer window rather than take the current window to the destination folder, it sounds like small problem but it gets annoying quick if you have to frequently swap between folders (theyre art assets).

    Is there any other way to do this or at least have it use the current window or close the old one?
      My Computer


  2. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #2

    Hi Nums,

    Short answer: There is! But not through standard link files.

    Long(er) answer: Shortcut files (.lnk) on USBs, which have varying drive letters, have been a flaw in Windows for a very long time. Link files only work with absolute paths. They simply won't work on external devices because of this.

    However, there is a little known path linking feature in Windows called Symbolic links which act just like a shortcut would but they are able to take in absolute paths as well as relative paths.

    Windows does a great job at hiding the feature from standard users, though, as there is no way to create one from the GUI. Creating a Symbolic link requires a command that must be issued to cmd.exe.

    Using your example directory tree, the command for creating a Symbolic link from Folders 1\A to 3\B would be:

    Code:
    mklink /d "1\C" "..\3\B"
    Last edited by Pyprohly; 09 Nov 2014 at 07:09.
      My Computer


  3. Posts : 52
    Windows 7 Home 64bit
    Thread Starter
       #3

    That works perfectly.
    Thank you!
      My Computer


  4. Posts : 6
    Win7 64-bit Home Premium
       #4

    yes, but please see Relative for caveats
      My Computer


 

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

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