1.    25 Mar 2017 #1
    Join Date : Dec 2015
    Posts : 72
    Windows10

    Exclude folder form Symbolic link ?


    Can I use Xcopy / Robocopy to create not only a symbolic link but exclude a folder from the symbolic link creation ?
      My ComputerSystem Spec
  2.    25 Mar 2017 #2
    Join Date : May 2015
    Central IL
    Posts : 4,221
    Mac OS Sierra

    What is the reason why you are trying to create the Symbolic link? No need for some third party software to do this, since Windows can already do it on its own. The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows A little more information for you. What are Symbolic Links? How do you create Symlinks in Windows 10?
      My ComputerSystem Spec
  3.    26 Mar 2017 #3
    Join Date : Aug 2016
    S/E England
    Posts : 4,488
    10 Home x64 (1709) (10 Pro on 2nd pc)

    Quote Originally Posted by bro67 View Post
    What is the reason why you are trying to create the Symbolic link? No need for some third party software to do this, since Windows can already do it on its own.
    Xcopy and Robocopy are not third party apps - they are Windows 10 command line utilities, presumably being used here to make backup copies of user files. I wrote my own .bat file using Robocopy that does full or incremental backups of my user folder to an external or network drive of my choice. I very soon learned the perils of Robocopy and symbolic links...
    The dangers of robocopy and symbolic links

    The switch I had to use for Robocopy is:
    /XJD :: eXclude Junction points for Directories.

    This one may be of use to @JerometheGiraff:
    /SL :: copy symbolic links versus the target.

    You could try combining that with...
    /XD dirs [dirs]... :: eXclude Directories matching given names/paths.
    ...but I'm not sure if that applies to symbolic links.

    Get to Know Robocopy for More Powerful File Management
    Robocopy and a Few Examples
    Type Robocopy /? in a command prompt for the full list of options or see:
    https://technet.microsoft.com/en-gb/...mands/robocopy

    Xcopy is far older than Robocopy and dates back to DOS 3.2. It supports the options:

    /EXCLUDE:file1[+file2][+file3]...
    Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the
    strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively.
    ....
    /B Copies the Symbolic Link itself versus the target of the link.

    Type Xcopy /? for the full list.
    Last edited by Bree; 26 Mar 2017 at 02:15. Reason: add Xcopy
      My ComputersSystem Spec
  4.    26 Mar 2017 #4
    Join Date : Dec 2015
    Posts : 72
    Windows10
    Thread Starter

    What does the following mean with regards to Robocopy; Is it simply re-phrasing what symbolic links create in general ?
    /SL :: copy symbolic links versus the target.
      My ComputerSystem Spec
  5.    26 Mar 2017 #5
    Join Date : Aug 2016
    S/E England
    Posts : 4,488
    10 Home x64 (1709) (10 Pro on 2nd pc)

    I read...
    /SL :: copy symbolic links versus the target.
    ...as:

    /SL :: copy the symbolic links as symbolic links versus copying the target files/directories that the links point to

    ...but it's not something I've tried yet so can't be sure.
      My ComputersSystem Spec
  6.    26 Mar 2017 #6
    Join Date : Dec 2015
    Posts : 72
    Windows10
    Thread Starter

    "C:\<directoryName> /sl /xd dirs <SubdirectorytoExclude>" "<SymbolicLinkDirectoryLocationToCreate>"
    The above minus the folder\directory names is the command I tried to create a symbolic link but exclude a sub-directory\folder from the source directory\folder. Instead I got an Error3 (0x00000003) from Robocopy ?
      My ComputerSystem Spec
  7.    26 Mar 2017 #7
    Join Date : Aug 2016
    S/E England
    Posts : 4,488
    10 Home x64 (1709) (10 Pro on 2nd pc)

    Error 3 is 'system cannot find path specified'. You appear to have put your destination at the end of the command (as you would for Xcopy).
    The Robocopy syntax takes some getting used to. If you’re familiar with the standard Copy and Xcopy commands, you’ll have to unlearn their syntax and get used to Robocopy’s unconventional ways.
    Get to Know Robocopy for More Powerful File Management

    That is not the correct order for Robocopy - it's 'source' 'destination' 'files' 'switches'.

    Usage :: ROBOCOPY source destination [file [file]...] [options]
    source :: Source Directory (drive:\path or \\server\share\path).
    destination :: Destination Dir (drive:\path or \\server\share\path).
    file :: File(s) to copy (names/wildcards: default is "*.*").
    You may also find it useful to set retries to zero with /r:0 (in case of locked files) otherwise the default is 1 million retries (with a 30 second wait between each)
      My ComputersSystem Spec
  8.    26 Mar 2017 #8
    Join Date : Dec 2015
    Posts : 72
    Windows10
    Thread Starter

    Using this command Robocopy did work, although not in the way I wanted it to work.

    "C:\<sourceFolderPath>" "C:\<folderA>" /sl /xd

    Two things;
    a) Symbolic link wasn't created which linked the source to the new target
    b) Sub-folder I specified wasn't excluded from being included in the Symbolic link creation
      My ComputerSystem Spec
  9.    26 Mar 2017 #9
    Join Date : Aug 2016
    S/E England
    Posts : 4,488
    10 Home x64 (1709) (10 Pro on 2nd pc)

    I'm afraid we're fast approaching (exceeded?) the limits of my knowledge/experience. Hopefully someone else may be along to help.
      My ComputersSystem Spec
  10.    26 Mar 2017 #10
    Join Date : Dec 2015
    Posts : 72
    Windows10
    Thread Starter

    I hope
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
Hard link directory junctions in User folder
So, I am looking for an easy way to redirect Documents, Downloads, Music and Pictures in the user folder to a data drive. I don't want anything permanent that is going to interfere with the Creator's update coming up. Does anyone know if there any...
User Accounts and Family Safety
How to delete USER FOLDER link
Have been using Win10 for about 6 months when a User folder icon appeared on the Desktop. No idea what I did to make it happen. I believe the Desktop User folder is a link to the C:/Users/file Adding or deleting a file in the C:/Users/file also...
General Support
Solved Is there a way to exclude only 1 particular driver in updates?
I determined the high resource usage when idle (laptop) was caused by the Synaptic Touchpad drivers. Upon uninstall, Win10 will immediately start downloading and installing the driver. :really: I disabled automatic driver updates. However, I...
Windows Updates and Activation
junction point/symbolic link query : multiple DOCUMENTS folders
hi my documents folder is on e: as c: is a ssd with limited space. somehow i managed to end up with three 'documents' folders in explorer of which two contain a few folders and the third one many folders, the latter is my real documents folder....
General Support
Missing Desktop link in user folder ?
Please can anyone help me with a small problem ? if I right click on my music icon in explorer I can change the location of its contents in the location tab which I was trying to do, as I have my Mp3s in a music folder on my D Drive. whilst...
General Support
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:05.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums