I'm attempting to consolidate a large list, and exclude a pre-determinded selection of folders.
This is what I'm trying to fun:
I used to have no issues, until my list of folders to ignore jumped drastically. So now my problem is that I can no longer successfully perform this action because I receive this error:
This issue only comes up when I try to exclude (with /XD) a very large list (~1000 folders to exclude). The full length of the input folders comes down to less than 16000 characters (including spaces and quotation marks). The error also only shows up further down the list of folders and appears to an insignificant number of characters or words (there are no special characters breaking it either).
The only way I've found to do what I need to, is copy over ALL the folders, then run multiple instances of window's remove directory command "rd /s /q <large list of Folders>". But...this is inefficient and takes time...
So my question is: is there a character limit on the input for the /XD parameter or a limit on robocopy at all? I Google'd this, but only found a command prompt line limit of ~32000 characters.
I'm also open to other suggestions on how to do this as long as it works as well as robocopy does in copy time stamps and other metadata.
update: found a way to use powershell that works
This is what I'm trying to fun:
Code:
robocopy "C:\Source\Folder" Destination\Folder /MIR /DCOPY:T /XD <large list of folders>
I used to have no issues, until my list of folders to ignore jumped drastically. So now my problem is that I can no longer successfully perform this action because I receive this error:
Code:
<Folder_Name_Here> is not recognized as an internal or external command, operable program or batch file.
This issue only comes up when I try to exclude (with /XD) a very large list (~1000 folders to exclude). The full length of the input folders comes down to less than 16000 characters (including spaces and quotation marks). The error also only shows up further down the list of folders and appears to an insignificant number of characters or words (there are no special characters breaking it either).
The only way I've found to do what I need to, is copy over ALL the folders, then run multiple instances of window's remove directory command "rd /s /q <large list of Folders>". But...this is inefficient and takes time...
So my question is: is there a character limit on the input for the /XD parameter or a limit on robocopy at all? I Google'd this, but only found a command prompt line limit of ~32000 characters.
I'm also open to other suggestions on how to do this as long as it works as well as robocopy does in copy time stamps and other metadata.
update: found a way to use powershell that works
Code:
gc list.txt | % { robocopy c:\source d:\dest $_ }
Last edited: