Create Soft and Hard Symbolic Links in Windows  

Page 8 of 9 FirstFirst ... 6789 LastLast

  1. Posts : 373
    Windows 10 Home 21H2
       #70

    .
    That looks great Thanks.

    I'm going to investigate that now.

    It's a lot safer than BAT files. I'm nervous using these now. I'm likely to blow away everything.

    I was just about to investigate CMD before you posted.
    .
      My Computer


  2. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #71

    OldGrantonian said:
    I tried OPTION FOUR, Create Junction Point to Directory in Command Prompt
    Code:
    mklink /j "C:\Users\Alan\AppData\Roaming" "D:\AppData_Roaming"
    D:\AppData_Roaming already existed. I got the error:
    Code:
    Cannot create a file when that file already exists.
    So I deleted the folder "AppData_Roaming". I retried mklink.
    Alan,

    You cannot achieve what you want this way.

    In the command

    mklink /j "C:\Users\Alan\AppData\Roaming" "D:\AppData_Roaming"

    you are creating an object at

    "C:\Users\Alan\AppData\Roaming"

    that, when called, reroutes the call to

    "D:\AppData_Roaming"


    Because you are trying to create "C:\Users\Alan\AppData\Roaming", it must not already exist.


    All the best,
    Denis
      My Computer


  3. Posts : 373
    Windows 10 Home 21H2
       #72

    .
    Success:

    I used Shawn's alternative code in post #68

    mklink /j "D:\AppData_Roaming" "C:\Users\Alan\AppData\Roaming"

    That code was clearly explained by Denis in #71.

    I've been watching the files on D: updating second by second.

    That's exactly what I need during Macrium Backups or Restores. (Drive D is never part of my Backup.)

    Thanks
    .
      My Computer


  4. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #73

    OldGrantonian said:
    I used Shawn's alternative code in post #68
    mklink /j "D:\AppData_Roaming" "C:\Users\Alan\AppData\Roaming"
    That code was clearly explained by Denis in #71.
    I've been watching the files on D: updating second by second.
    In the command

    mklink /j "D:\AppData_Roaming" "C:\Users\Alan\AppData\Roaming"

    you are creating an object at

    "D:\AppData_Roaming"

    that, when called, reroutes the call to

    "C:\Users\Alan\AppData\Roaming"



    Because you are trying to create "D:\AppData_Roaming", it must not already exist.
    But who are you expecting to call

    "D:\AppData_Roaming"

    anyway?




    All the best,
    Denis
      My Computer


  5. Posts : 373
    Windows 10 Home 21H2
       #74

    .
    Try3 said:
    But who are you expecting to call

    "D:\AppData_Roaming"

    anyway?
    .
    I think the answer is "me"

    In other words, if I now want look in Roaming, I'll look in exactly the same place as I've always been looking:

    C:\Users\Alan\AppData\Roaming <ADR>

    I'm expecting to see the files that are actually physically located at D: - and will be fully up to date.

    Except for testing, I would never use File Explorer to look at the phsical files in D:. I don't want to change my normal working practices. Too much danger of disasters.

    I might investigate putting some kind of lock on AppData_Roaming, to prevent accidental disasters.

    I'm not sure what Macrium will see in ADR. I don't care. I'm not using D: to save space. (I would prefer to spend more money if I needed more space.) I'm using D: to give me up-to-date info.

    With the greatest respect to the generous volunteers here, I can't get my head around "call". I prefer the HowToGeek's use of "point" - here:

    The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows

    They say:

    Use /J to create a hard link POINTING to a directory, also known as a directory junction:

    mklink /J Link Target

    All Engineers of my age are completely at home with pointers in "unsafe" languages such as C and Perl. Both of these have pointers to pointers to pointers to.... - with massive computing power. UML Sequence Diagrams are a cinch in Perl. But I don't understand Java's Refs - which I think might be similar to "call".

    It's easy for me to visualize a signpost pointing to "The proper part of London".

    But I just can't get my head around the idea of standing in the middle of the better part of London (assuming it's actually big enough to have a middle), and calling the signpost to find out where I am.

    Thanks
    .
      My Computer


  6. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #75

    You have created an object that redirects to somewhere else.
    That object is, in your case, "D:\AppData_Roaming" and when anything or anybody calls it or points to it, they will be redirected to "C:\Users\Alan\AppData\Roaming"
    This behaviour is explained in the tutorial.
    It is also explained in the HTG webpage you posted a link to.
    I posted links to several other explanations of the command in my ditty on junctions etc #3 - TenForums

    Your command seems to be the opposite of what you said you wanted.
    - The intended files must be in "C:\Users\Alan\AppData\Roaming" for a call / point to "D:\AppData_Roaming" to find them so space in your C:\ drive is used up.
    - The redirection point itself, "D:\AppData_Roaming", has zero size and does not use up any space on your D:\ drive.


    All the best,
    Denis
      My Computer


  7. Posts : 373
    Windows 10 Home 21H2
       #76

    .
    Try3 said:
    You have created an object that redirects to somewhere else.
    That object is, in your case, "D:\AppData_Roaming" and when anything or anybody calls it or points to it, they will be redirected to "C:\Users\Alan\AppData\Roaming"
    This behaviour is explained in the tutorial.
    It is also explained in the HTG webpage you posted a link to.
    I posted links to several other explanations of the command in my ditty on junctions etc #3 - TenForums

    Your command seems to be the opposite of what you said you wanted.
    - The intended files must be in "C:\Users\Alan\AppData\Roaming" for a call / point to "D:\AppData_Roaming" to find them so space in your C:\ drive is used up.
    - The redirection point itself, "D:\AppData_Roaming", has zero size and does not use up any space on your D:\ drive.


    All the best,
    Denis
    .
    The space-saving (if any) is a "nice to have", but has a much lower priority.
    .
    My main objective is to ensure that some apps are updated in real time. This means that I don't need to remember to do a static Robocopy just before any Macrium Restore.

    You say: Your command seems to be the opposite of what you said you wanted.

    I think you're correct.

    And thanks for taking the time to monitor what I'm doing.

    I've only done HALF a test.

    As mentioned earlier, here is my half test for CintaNotes (CN). Similar tests were done for 3 other indispensable apps.

    C means:
    C:\Users\Alan\AppData\Roaming\CintaNotes

    D means:
    D:\AppData_Roaming

    - Keep File Explorer pointing to D
    - Add 2 new notes in CN
    - D updates "Date modified" almost immediately. C does not change (except for a small number of exceptions - 1 or 2. Puzzling)

    Here's the other half of the test - which I did NOT do.

    - Close CN (to break any links)
    - Open CN
    - Sort notes by "Date Modified"
    - Now the latest notes don't appear. (Not a disaster. I don't think I've made any genuine notes today - or any genuine changes to other apps)

    D still shows the correct times for various additions and updates to notes.

    I think this is what's happening. At startup, the program itself is looking in C for its data. That data hasn't been updating.

    Therefore, new notes are not showing.

    Question:

    If I delete the links, and reverse the arguments for mklink, will that achieve my main objective: dynamic updating? (Ignore the space issue.)

    Thanks
    Last edited by OldGrantonian; 12 Jun 2023 at 11:35.
      My Computer


  8. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #77

    Alan,

    I still think your relocation experiment was the most promising route for you as long as you dealt with all the Roaming subfolders listed in the User shell folders Key.

    I cannot find that thread now. I found How to move AppData files from C: to D: ? but cannot find the one in which I posted this diagram
    Create Soft and Hard Symbolic Links in Windows-appdata-roaming-its-subfolders.png


    All the best,
    Denis

    Found it - How to Add or Remove Location tab in Folder Properties - post #7 - TenForumsTutorials
      My Computer


  9. Posts : 373
    Windows 10 Home 21H2
       #78

    .
    Try3 said:
    I still think your relocation experiment was the most promising route for you as long as you dealt with all the Roaming subfolders listed in the User shell folders Key.
    .
    User Shell Folders
    I changed the entry in User Shell Folders to use
    %USERPROFILE%
    instead of
    C:\Users\Alan

    Rebooted.

    Looked in Shell Folders. The format was identical to the other entries.

    I stepped down the
    C:\Users\Alan\AppData hierarchy until I found a Location tab.

    AppData had no Location tab. Roaming had the tab. So we were back in business.

    I set the target to D:\AppData_Roaming
    It complained "Can't xxx into Reparse Point. Please choose a different Target path".

    That makes sense, we applied a Junction Point to the folder earlier in this marathon. (The "xxx" means I can't read my own handwriting. Fortunately, I don't think that matters here.)

    Reminder: We need to cancel that Junction Point that we created - for safety. I couldn't see a tutorial for that in the List of tutorials here:

    Ten Forums Tutorials - Google Drive

    The rest of the move operation was simple follow-the-prompts.

    If I create test data for the apps that need to update dynamically, I now see the opposite to what I saw earlier after the Junction Point Creation earlier.

    Now the C:\Users\Alan\AppData\Roaming folder updates by the second.

    But the timestamps in AppData-Roaming folder on D: are fixed at the exact time the move took place.

    It looks good, but I'm not cheering too loudly until I find how Macrium reacts to fake folders with pointers. Should be OK. IMO, Macrium is just a dumb, byte-by-byte hex copier. I don't think it will look for files on D: (Said he, with total lack of confidence.)

    TODO: Remove the Junction Point on D:

    Thanks for all the help.
    .
      My Computer


  10. Posts : 16,953
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #79

    If, as I think, you are now pursuing the folder relocation method:-
    You have not mentioned the Registry entries in my last diagram, such as %USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo, that contain AppData\Roaming in their paths.
    I don't know why you changed %USERPROFILE% to C:\Users\Alan. It's just six of one and half a dozen of the other.


    If you were continuing to pursue the redirection point method:-
    "I set the target to D:\AppData_Roaming
    It complained "Can't xxx into Reparse Point. Please choose a different Target path"."
    It is the C:\Users\Alan\AppData\Roaming link that is the problem. It already exists. That's why it complains.
    You could try logging out of Alan & logging into a different Admin user account then use the command prompt to delete C:\Users\Alan\AppData\Roaming and to create the redirection point at the same time using the command in post #71.
    - You might well have to take ownership of the folder in order to delete it because it is currently owned by Alan.
    - Don't accidentally delete C:\Users\%UserName%\AppData\Roaming because that would be the folder for the other Admin user account you were currently logged in to.


    All the best,
    Denis
      My Computer


 

Tutorial Categories

Create Soft and Hard Symbolic Links in Windows Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  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 15:38.
Find Us




Windows 10 Forums