Robocopy is ignoring /xd directories












1















I am trying to use Robocopy to create client software builds by copying all the necessary files out of our main repository. We have multiple clients each needing their own custom software builds.



I have a list of requirements for each client's build. My thinking is to copy over the core stuff first (binaries and such, used by all clients) and then copy over the client specific stuff depending on for whom I'm making a build by making use of these lists. We have something like this already working with xcopy.



There is obviously a bunch of stuff I want excluded from the client build such as source files, log files and obviously all the client specific stuff. I thought by making clever use of the /xf and /xd switches I should be able to get it to work.



After a getting all the needed info, the following command is built in Lua:



robocopy "Z:pathtosource" "../dest"  /e /xf *.cpp *.h *.hpp [[. . .]] *.cxx   /xd Data/Testing Data/Some/Client/Data Data/Other/Client/Data [[ . . .]] Data/More/Directories 


When running it I get the following output:



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, August 1, 2017 11:15:59 AM
Source : Z:pathtosource
Dest : ../dest

Files : *.*

Exc Files : *.cpp
*.h
*.hpp
[[. . .]]
*.cxx

Exc Dirs : Data/Testing
Data/Some/Client/Data
Data/Other/Client/Data
[[ . . .]]
Data/More/Directories

Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------


The output tells me my command is formatted properly and that Robocopy understands what I'm asking it to do.



The problem is that it's straight up ignoring the Exc dirs list and is just copying everything. I do not want to exclude the whole Data directory, but only the bits inside it that are relevant.



If I use back slashes () then the Exc dirs output is printed like Data\testing. Could this be my issue?










share|improve this question























  • Did you try to use absolute paths? Did you try to build a small example to see what kind of slashes you need?

    – Seth
    Aug 1 '17 at 11:43











  • I am trying to avoid absolute paths because the scripts must be able to run on any machine, with the repository installed anywhere. The script is part of the main repository, so we use relative paths then. I am building a small example now to test the theory of the slashes.

    – getack
    Aug 1 '17 at 11:47











  • If you don't want to use full explicit paths of the excluded then just use the sub folder name only of some top level subfolder name, etc. to tell the job to exclude i.e. /XD "Testing Data" "More" and that should work but for all subfolders matching that name so you may need to rethink the folder naming for the dirs you want to exclude and append a character to make them unique if the name is not unique otherwise per the job so "/z_Testing Data" for example. Otherwise, consider putting dirs to not backup in a standard top level parent folder e.g. NoBackupTesting Data. Simple to test.

    – Pimp Juice IT
    Aug 1 '17 at 12:39











  • Our repository is almost 20 years old. Changing the directory layout to something more sensible is unfortunately not possible due to technical inertia.

    – getack
    Aug 1 '17 at 13:29











  • I don't really get why you would not be able to use absolute paths. Your original question states you're generating the robocopy line using LUA and also already include an absolute path. But well, it seems you've found an answer that works for you. Interesting though that your XCOPY approach works as it should have the same behavior. Maybe exclude the full example of what you did in your answer, as it might be helpful.

    – Seth
    Aug 2 '17 at 5:53
















1















I am trying to use Robocopy to create client software builds by copying all the necessary files out of our main repository. We have multiple clients each needing their own custom software builds.



I have a list of requirements for each client's build. My thinking is to copy over the core stuff first (binaries and such, used by all clients) and then copy over the client specific stuff depending on for whom I'm making a build by making use of these lists. We have something like this already working with xcopy.



There is obviously a bunch of stuff I want excluded from the client build such as source files, log files and obviously all the client specific stuff. I thought by making clever use of the /xf and /xd switches I should be able to get it to work.



After a getting all the needed info, the following command is built in Lua:



robocopy "Z:pathtosource" "../dest"  /e /xf *.cpp *.h *.hpp [[. . .]] *.cxx   /xd Data/Testing Data/Some/Client/Data Data/Other/Client/Data [[ . . .]] Data/More/Directories 


When running it I get the following output:



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, August 1, 2017 11:15:59 AM
Source : Z:pathtosource
Dest : ../dest

Files : *.*

Exc Files : *.cpp
*.h
*.hpp
[[. . .]]
*.cxx

Exc Dirs : Data/Testing
Data/Some/Client/Data
Data/Other/Client/Data
[[ . . .]]
Data/More/Directories

Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------


The output tells me my command is formatted properly and that Robocopy understands what I'm asking it to do.



The problem is that it's straight up ignoring the Exc dirs list and is just copying everything. I do not want to exclude the whole Data directory, but only the bits inside it that are relevant.



If I use back slashes () then the Exc dirs output is printed like Data\testing. Could this be my issue?










share|improve this question























  • Did you try to use absolute paths? Did you try to build a small example to see what kind of slashes you need?

    – Seth
    Aug 1 '17 at 11:43











  • I am trying to avoid absolute paths because the scripts must be able to run on any machine, with the repository installed anywhere. The script is part of the main repository, so we use relative paths then. I am building a small example now to test the theory of the slashes.

    – getack
    Aug 1 '17 at 11:47











  • If you don't want to use full explicit paths of the excluded then just use the sub folder name only of some top level subfolder name, etc. to tell the job to exclude i.e. /XD "Testing Data" "More" and that should work but for all subfolders matching that name so you may need to rethink the folder naming for the dirs you want to exclude and append a character to make them unique if the name is not unique otherwise per the job so "/z_Testing Data" for example. Otherwise, consider putting dirs to not backup in a standard top level parent folder e.g. NoBackupTesting Data. Simple to test.

    – Pimp Juice IT
    Aug 1 '17 at 12:39











  • Our repository is almost 20 years old. Changing the directory layout to something more sensible is unfortunately not possible due to technical inertia.

    – getack
    Aug 1 '17 at 13:29











  • I don't really get why you would not be able to use absolute paths. Your original question states you're generating the robocopy line using LUA and also already include an absolute path. But well, it seems you've found an answer that works for you. Interesting though that your XCOPY approach works as it should have the same behavior. Maybe exclude the full example of what you did in your answer, as it might be helpful.

    – Seth
    Aug 2 '17 at 5:53














1












1








1








I am trying to use Robocopy to create client software builds by copying all the necessary files out of our main repository. We have multiple clients each needing their own custom software builds.



I have a list of requirements for each client's build. My thinking is to copy over the core stuff first (binaries and such, used by all clients) and then copy over the client specific stuff depending on for whom I'm making a build by making use of these lists. We have something like this already working with xcopy.



There is obviously a bunch of stuff I want excluded from the client build such as source files, log files and obviously all the client specific stuff. I thought by making clever use of the /xf and /xd switches I should be able to get it to work.



After a getting all the needed info, the following command is built in Lua:



robocopy "Z:pathtosource" "../dest"  /e /xf *.cpp *.h *.hpp [[. . .]] *.cxx   /xd Data/Testing Data/Some/Client/Data Data/Other/Client/Data [[ . . .]] Data/More/Directories 


When running it I get the following output:



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, August 1, 2017 11:15:59 AM
Source : Z:pathtosource
Dest : ../dest

Files : *.*

Exc Files : *.cpp
*.h
*.hpp
[[. . .]]
*.cxx

Exc Dirs : Data/Testing
Data/Some/Client/Data
Data/Other/Client/Data
[[ . . .]]
Data/More/Directories

Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------


The output tells me my command is formatted properly and that Robocopy understands what I'm asking it to do.



The problem is that it's straight up ignoring the Exc dirs list and is just copying everything. I do not want to exclude the whole Data directory, but only the bits inside it that are relevant.



If I use back slashes () then the Exc dirs output is printed like Data\testing. Could this be my issue?










share|improve this question














I am trying to use Robocopy to create client software builds by copying all the necessary files out of our main repository. We have multiple clients each needing their own custom software builds.



I have a list of requirements for each client's build. My thinking is to copy over the core stuff first (binaries and such, used by all clients) and then copy over the client specific stuff depending on for whom I'm making a build by making use of these lists. We have something like this already working with xcopy.



There is obviously a bunch of stuff I want excluded from the client build such as source files, log files and obviously all the client specific stuff. I thought by making clever use of the /xf and /xd switches I should be able to get it to work.



After a getting all the needed info, the following command is built in Lua:



robocopy "Z:pathtosource" "../dest"  /e /xf *.cpp *.h *.hpp [[. . .]] *.cxx   /xd Data/Testing Data/Some/Client/Data Data/Other/Client/Data [[ . . .]] Data/More/Directories 


When running it I get the following output:



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, August 1, 2017 11:15:59 AM
Source : Z:pathtosource
Dest : ../dest

Files : *.*

Exc Files : *.cpp
*.h
*.hpp
[[. . .]]
*.cxx

Exc Dirs : Data/Testing
Data/Some/Client/Data
Data/Other/Client/Data
[[ . . .]]
Data/More/Directories

Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------


The output tells me my command is formatted properly and that Robocopy understands what I'm asking it to do.



The problem is that it's straight up ignoring the Exc dirs list and is just copying everything. I do not want to exclude the whole Data directory, but only the bits inside it that are relevant.



If I use back slashes () then the Exc dirs output is printed like Data\testing. Could this be my issue?







windows command-line robocopy






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 1 '17 at 11:33









getackgetack

6628




6628













  • Did you try to use absolute paths? Did you try to build a small example to see what kind of slashes you need?

    – Seth
    Aug 1 '17 at 11:43











  • I am trying to avoid absolute paths because the scripts must be able to run on any machine, with the repository installed anywhere. The script is part of the main repository, so we use relative paths then. I am building a small example now to test the theory of the slashes.

    – getack
    Aug 1 '17 at 11:47











  • If you don't want to use full explicit paths of the excluded then just use the sub folder name only of some top level subfolder name, etc. to tell the job to exclude i.e. /XD "Testing Data" "More" and that should work but for all subfolders matching that name so you may need to rethink the folder naming for the dirs you want to exclude and append a character to make them unique if the name is not unique otherwise per the job so "/z_Testing Data" for example. Otherwise, consider putting dirs to not backup in a standard top level parent folder e.g. NoBackupTesting Data. Simple to test.

    – Pimp Juice IT
    Aug 1 '17 at 12:39











  • Our repository is almost 20 years old. Changing the directory layout to something more sensible is unfortunately not possible due to technical inertia.

    – getack
    Aug 1 '17 at 13:29











  • I don't really get why you would not be able to use absolute paths. Your original question states you're generating the robocopy line using LUA and also already include an absolute path. But well, it seems you've found an answer that works for you. Interesting though that your XCOPY approach works as it should have the same behavior. Maybe exclude the full example of what you did in your answer, as it might be helpful.

    – Seth
    Aug 2 '17 at 5:53



















  • Did you try to use absolute paths? Did you try to build a small example to see what kind of slashes you need?

    – Seth
    Aug 1 '17 at 11:43











  • I am trying to avoid absolute paths because the scripts must be able to run on any machine, with the repository installed anywhere. The script is part of the main repository, so we use relative paths then. I am building a small example now to test the theory of the slashes.

    – getack
    Aug 1 '17 at 11:47











  • If you don't want to use full explicit paths of the excluded then just use the sub folder name only of some top level subfolder name, etc. to tell the job to exclude i.e. /XD "Testing Data" "More" and that should work but for all subfolders matching that name so you may need to rethink the folder naming for the dirs you want to exclude and append a character to make them unique if the name is not unique otherwise per the job so "/z_Testing Data" for example. Otherwise, consider putting dirs to not backup in a standard top level parent folder e.g. NoBackupTesting Data. Simple to test.

    – Pimp Juice IT
    Aug 1 '17 at 12:39











  • Our repository is almost 20 years old. Changing the directory layout to something more sensible is unfortunately not possible due to technical inertia.

    – getack
    Aug 1 '17 at 13:29











  • I don't really get why you would not be able to use absolute paths. Your original question states you're generating the robocopy line using LUA and also already include an absolute path. But well, it seems you've found an answer that works for you. Interesting though that your XCOPY approach works as it should have the same behavior. Maybe exclude the full example of what you did in your answer, as it might be helpful.

    – Seth
    Aug 2 '17 at 5:53

















Did you try to use absolute paths? Did you try to build a small example to see what kind of slashes you need?

– Seth
Aug 1 '17 at 11:43





Did you try to use absolute paths? Did you try to build a small example to see what kind of slashes you need?

– Seth
Aug 1 '17 at 11:43













I am trying to avoid absolute paths because the scripts must be able to run on any machine, with the repository installed anywhere. The script is part of the main repository, so we use relative paths then. I am building a small example now to test the theory of the slashes.

– getack
Aug 1 '17 at 11:47





I am trying to avoid absolute paths because the scripts must be able to run on any machine, with the repository installed anywhere. The script is part of the main repository, so we use relative paths then. I am building a small example now to test the theory of the slashes.

– getack
Aug 1 '17 at 11:47













If you don't want to use full explicit paths of the excluded then just use the sub folder name only of some top level subfolder name, etc. to tell the job to exclude i.e. /XD "Testing Data" "More" and that should work but for all subfolders matching that name so you may need to rethink the folder naming for the dirs you want to exclude and append a character to make them unique if the name is not unique otherwise per the job so "/z_Testing Data" for example. Otherwise, consider putting dirs to not backup in a standard top level parent folder e.g. NoBackupTesting Data. Simple to test.

– Pimp Juice IT
Aug 1 '17 at 12:39





If you don't want to use full explicit paths of the excluded then just use the sub folder name only of some top level subfolder name, etc. to tell the job to exclude i.e. /XD "Testing Data" "More" and that should work but for all subfolders matching that name so you may need to rethink the folder naming for the dirs you want to exclude and append a character to make them unique if the name is not unique otherwise per the job so "/z_Testing Data" for example. Otherwise, consider putting dirs to not backup in a standard top level parent folder e.g. NoBackupTesting Data. Simple to test.

– Pimp Juice IT
Aug 1 '17 at 12:39













Our repository is almost 20 years old. Changing the directory layout to something more sensible is unfortunately not possible due to technical inertia.

– getack
Aug 1 '17 at 13:29





Our repository is almost 20 years old. Changing the directory layout to something more sensible is unfortunately not possible due to technical inertia.

– getack
Aug 1 '17 at 13:29













I don't really get why you would not be able to use absolute paths. Your original question states you're generating the robocopy line using LUA and also already include an absolute path. But well, it seems you've found an answer that works for you. Interesting though that your XCOPY approach works as it should have the same behavior. Maybe exclude the full example of what you did in your answer, as it might be helpful.

– Seth
Aug 2 '17 at 5:53





I don't really get why you would not be able to use absolute paths. Your original question states you're generating the robocopy line using LUA and also already include an absolute path. But well, it seems you've found an answer that works for you. Interesting though that your XCOPY approach works as it should have the same behavior. Maybe exclude the full example of what you did in your answer, as it might be helpful.

– Seth
Aug 2 '17 at 5:53










1 Answer
1






active

oldest

votes


















0














robocopy is advertised as the replacement for xcopy but if it's unable to do something simple as what I want then it's truly a terrible replacement.



Any directory name after /xd that matches is excluded. This makes sense and it functions as advertised. Looks like any time you give it anything more than just a directory name then it wets the bed. My problem is surely not so unique looking at some of the other people on the internet and their troubles with robocopy.



I have the following directories:



C:repoSomeProjectData             <- DONT exclude this
C:repoSomeOtherProjectData <- DONT exclude this
C:repoAnotherProjectbar <- DONT exclude this
C:repoDatafoo <- Exclude this
C:repoDatabar <- Exclude this
C:repoDatabaz <- DONT exclude this



  • If I call robocopy with /xd Data then C:repoSomeProjectData and C:repoSomeOtherProjectData will also be excluded

  • If I call robocopy with /xd foo bar then
    C:repoAnotherProjectbar will also be excluded.


I want to be able to call robocopy with /xd Datafoo Databar so that only foo and bar in Data will be excluded.



Absolute file paths will not work because the code must be portable and I don't really want to inject absolute paths for each entry in my >100 excludes list. It just doesn't seem right.



What appears to happen is if I use /xd Databar then robocopy interprets it as Data\bar which it cannot find. I do not know why a single is changed to \ and any permutation of or / does not work either.



The solution



So ultimately the answer to my question is to use xcopy. I give it a list containing entries such as *.cpp, 8.vcxproj, Datafoo, Databar and a 100 other entries and it seems to work just fine excluding all the stuff I don't want while keeping the stuff I need.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1236486%2frobocopy-is-ignoring-xd-directories%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    robocopy is advertised as the replacement for xcopy but if it's unable to do something simple as what I want then it's truly a terrible replacement.



    Any directory name after /xd that matches is excluded. This makes sense and it functions as advertised. Looks like any time you give it anything more than just a directory name then it wets the bed. My problem is surely not so unique looking at some of the other people on the internet and their troubles with robocopy.



    I have the following directories:



    C:repoSomeProjectData             <- DONT exclude this
    C:repoSomeOtherProjectData <- DONT exclude this
    C:repoAnotherProjectbar <- DONT exclude this
    C:repoDatafoo <- Exclude this
    C:repoDatabar <- Exclude this
    C:repoDatabaz <- DONT exclude this



    • If I call robocopy with /xd Data then C:repoSomeProjectData and C:repoSomeOtherProjectData will also be excluded

    • If I call robocopy with /xd foo bar then
      C:repoAnotherProjectbar will also be excluded.


    I want to be able to call robocopy with /xd Datafoo Databar so that only foo and bar in Data will be excluded.



    Absolute file paths will not work because the code must be portable and I don't really want to inject absolute paths for each entry in my >100 excludes list. It just doesn't seem right.



    What appears to happen is if I use /xd Databar then robocopy interprets it as Data\bar which it cannot find. I do not know why a single is changed to \ and any permutation of or / does not work either.



    The solution



    So ultimately the answer to my question is to use xcopy. I give it a list containing entries such as *.cpp, 8.vcxproj, Datafoo, Databar and a 100 other entries and it seems to work just fine excluding all the stuff I don't want while keeping the stuff I need.






    share|improve this answer




























      0














      robocopy is advertised as the replacement for xcopy but if it's unable to do something simple as what I want then it's truly a terrible replacement.



      Any directory name after /xd that matches is excluded. This makes sense and it functions as advertised. Looks like any time you give it anything more than just a directory name then it wets the bed. My problem is surely not so unique looking at some of the other people on the internet and their troubles with robocopy.



      I have the following directories:



      C:repoSomeProjectData             <- DONT exclude this
      C:repoSomeOtherProjectData <- DONT exclude this
      C:repoAnotherProjectbar <- DONT exclude this
      C:repoDatafoo <- Exclude this
      C:repoDatabar <- Exclude this
      C:repoDatabaz <- DONT exclude this



      • If I call robocopy with /xd Data then C:repoSomeProjectData and C:repoSomeOtherProjectData will also be excluded

      • If I call robocopy with /xd foo bar then
        C:repoAnotherProjectbar will also be excluded.


      I want to be able to call robocopy with /xd Datafoo Databar so that only foo and bar in Data will be excluded.



      Absolute file paths will not work because the code must be portable and I don't really want to inject absolute paths for each entry in my >100 excludes list. It just doesn't seem right.



      What appears to happen is if I use /xd Databar then robocopy interprets it as Data\bar which it cannot find. I do not know why a single is changed to \ and any permutation of or / does not work either.



      The solution



      So ultimately the answer to my question is to use xcopy. I give it a list containing entries such as *.cpp, 8.vcxproj, Datafoo, Databar and a 100 other entries and it seems to work just fine excluding all the stuff I don't want while keeping the stuff I need.






      share|improve this answer


























        0












        0








        0







        robocopy is advertised as the replacement for xcopy but if it's unable to do something simple as what I want then it's truly a terrible replacement.



        Any directory name after /xd that matches is excluded. This makes sense and it functions as advertised. Looks like any time you give it anything more than just a directory name then it wets the bed. My problem is surely not so unique looking at some of the other people on the internet and their troubles with robocopy.



        I have the following directories:



        C:repoSomeProjectData             <- DONT exclude this
        C:repoSomeOtherProjectData <- DONT exclude this
        C:repoAnotherProjectbar <- DONT exclude this
        C:repoDatafoo <- Exclude this
        C:repoDatabar <- Exclude this
        C:repoDatabaz <- DONT exclude this



        • If I call robocopy with /xd Data then C:repoSomeProjectData and C:repoSomeOtherProjectData will also be excluded

        • If I call robocopy with /xd foo bar then
          C:repoAnotherProjectbar will also be excluded.


        I want to be able to call robocopy with /xd Datafoo Databar so that only foo and bar in Data will be excluded.



        Absolute file paths will not work because the code must be portable and I don't really want to inject absolute paths for each entry in my >100 excludes list. It just doesn't seem right.



        What appears to happen is if I use /xd Databar then robocopy interprets it as Data\bar which it cannot find. I do not know why a single is changed to \ and any permutation of or / does not work either.



        The solution



        So ultimately the answer to my question is to use xcopy. I give it a list containing entries such as *.cpp, 8.vcxproj, Datafoo, Databar and a 100 other entries and it seems to work just fine excluding all the stuff I don't want while keeping the stuff I need.






        share|improve this answer













        robocopy is advertised as the replacement for xcopy but if it's unable to do something simple as what I want then it's truly a terrible replacement.



        Any directory name after /xd that matches is excluded. This makes sense and it functions as advertised. Looks like any time you give it anything more than just a directory name then it wets the bed. My problem is surely not so unique looking at some of the other people on the internet and their troubles with robocopy.



        I have the following directories:



        C:repoSomeProjectData             <- DONT exclude this
        C:repoSomeOtherProjectData <- DONT exclude this
        C:repoAnotherProjectbar <- DONT exclude this
        C:repoDatafoo <- Exclude this
        C:repoDatabar <- Exclude this
        C:repoDatabaz <- DONT exclude this



        • If I call robocopy with /xd Data then C:repoSomeProjectData and C:repoSomeOtherProjectData will also be excluded

        • If I call robocopy with /xd foo bar then
          C:repoAnotherProjectbar will also be excluded.


        I want to be able to call robocopy with /xd Datafoo Databar so that only foo and bar in Data will be excluded.



        Absolute file paths will not work because the code must be portable and I don't really want to inject absolute paths for each entry in my >100 excludes list. It just doesn't seem right.



        What appears to happen is if I use /xd Databar then robocopy interprets it as Data\bar which it cannot find. I do not know why a single is changed to \ and any permutation of or / does not work either.



        The solution



        So ultimately the answer to my question is to use xcopy. I give it a list containing entries such as *.cpp, 8.vcxproj, Datafoo, Databar and a 100 other entries and it seems to work just fine excluding all the stuff I don't want while keeping the stuff I need.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 1 '17 at 13:26









        getackgetack

        6628




        6628






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1236486%2frobocopy-is-ignoring-xd-directories%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Index of /

            Tribalistas

            Listed building