Create Soft and Hard Symbolic Links in Windows  

Page 5 of 9 FirstFirst ... 34567 ... LastLast

  1. Posts : 68,868
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #40

    Peter Pan said:
    Hello all,
    @Brink, there might be a couple of typos on your nice tutorial that has definitively clarified for me the use of the different types of reparse points used as links:
    - Option 4 - Create Junction Point to Directory in Command Prompt: Substitute Source Target in the command above with the full path of the folder (directory) that is the target (source) you want the hard link pointing to => AFAIK, a junction point is a soft link
    - Option 9 - Delete Hard Link, Symbolic Link, or Junction Point: Navigate to the location of the link or junction point, and delete it. This will not delete the target (source) the link/junction points to => it looks this to be wrong, at least in some contexts and according to the very informative article of Super User pointed by @hdmi.
    => "windows - "directory junction" vs "directory symbolic link"? - Super User": windows - "directory junction" vs "directory symbolic link"? - Super User

    Thanks in advance to confirm these two points.

    - - - Updated - - -

    According to my tests and the Super User thread, deleting a directory simlick with the del command does not delete any content in the source directory. I don't know if the behavior would depend on local or remote processing of the del command. I experienced it only locally in my side.
    Hello Peter,

    Deleting anything in the link/junction or target (source) folder will delete it in both folders.

    Deleting the hard link, symbolic link, or junction point itself will not delete anything in the target (source) folder.

    Find All Symbolic Links and Junction Points in Windows Tutorial | Windows 11 Forum
      My Computers


  2. Posts : 316
    Pro 20H2
       #41

    Results of my testing in one computer:
    Create Soft and Hard Symbolic Links in Windows-link.jpg
      My Computer


  3. Posts : 17
    Windows 10 Pro
       #42

    thename said:
    Results of my testing in one computer:
    Create Soft and Hard Symbolic Links in Windows-link.jpg
    Hello @thename, I do believe I get files preserved when using the del command with directory symlinks (symlinkD) and junctions, as recalled just above by @Brink. I will check it again on my computer.
      My Computer


  4. Posts : 316
    Pro 20H2
       #43

    Peter Pan said:
    I will check it
    Yes, please.
      My Computer


  5. Posts : 1,203
    11 Home
       #44

    thename said:
    Yes, please.
    Just like I already said, issuing the del command on a Junction or Directory Symlink (SymlinkD) causes both the link and the target folder to remain present. Only the files are deleted from the target folder. Whereas if you use File Explorer to delete the link, it just deletes the link, i.e., not the files inside the target folder nor anything else. Therefore, if you need to use the command line (or a batch script) instead of File Explorer, then if you only want to delete the Junction or SymlinkD, you need to use the rd (rmdir) command, not the del command. This holds true on Windows NT/2000/XP/Vista/7/8/8.1/10/11 and NTFS.
      My Computers


  6. Posts : 316
    Pro 20H2
       #45

    Minus the extraneous verbage, the simple point is no more than :
    hdmi said:
    del command on a Junction or Directory Symlink (SymlinkD).... files are deleted from the target folder.
      My Computer


  7. Posts : 1,203
    11 Home
       #46

    thename said:
    Minus the extraneous verbage, the simple point is no more than :
    Yes, BUT... too many people on here are incapable to understand simple points so that's why.
      My Computers


  8. Posts : 17
    Windows 10 Pro
       #47

    @hdmi and @thename, thank you for your inputs and the "extraneous verbage" that was useful for me
    Deleting a junction point or a symlinkD with the del command does work for me the same way you detailed.
    Just to mention that for my first tests, it was looking like it would work the same way described by @Brink, i.e. the del command applied to a symlinkD or a junction would not delete anything in the target folder. But I was just running "del <symlinkD/junction name>. Running "del [/Q /S] <symlinkD/junction name>\<filename to be deleted>" was the right command to delete any file or sub-folder in the target folder. Thanks again for the confirmation and "extraneous verbage"
      My Computer


  9. Posts : 1,203
    11 Home
       #48

    Peter Pan said:
    But I was just running "del <symlinkD/junction name>. Running "del [/Q /S] <symlinkD/junction name>\<filename to be deleted>" was the right command to delete any file or sub-folder in the target folder.
    del <symlinkD/junction name> is equivalent to del <target of the symlinkD/junction> (if we can assume that the symlinkD/junction name can be resolved by the del command).

    del <directory name> is equivalent to del <directory name>\* according to the explanation you get when you type del /? and, according to this same explanation, you can choose to suppress the confirmation prompt by adding the /Q option. The asterisk symbol * is called the global wildcard. The /S option allows you to specify individual files to be deleted, but this choice is entirely optional also. To summarize, it still deletes all the files if you choose NOT to use the /S option, and in fact the confirmation prompt also tells you─with laser-sharp verbiage that no one can deny─that <directory name>\* is what you're about to delete.
      My Computers


  10. Posts : 127
    Windows 10 Pro
       #49

    Does the recieving directory need to be there?
    Say you have mklink /j C:\program files\nch files\WordPad a:\applications \nch programs\[does this directory need to exist?]
    I have read yes and no. Will it create it on the a drive without it?

    John
      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 09:39.
Find Us




Windows 10 Forums