Search code examples
cmdxcopy

xcopy regex for excluding names


I have a folder named Account

I want to xcopy all its subfolders, but it two phases (i.e. two xcopy commands):

I want to splint this cmd:

xcopy /I /E /Y %env.working_directory%\Deployment\Account\Release*.* \file-srv\Archive\Products\Web\AccountsServices\Account.Toolbar\Nightly\Accounts_3.10_Merged\%system.build.number%

Account\folder1 in first xcopy

Account\ --> all other in second xcopy

How can I write the second xcopy? (regex for excluding "folder1")


Solution

  • (They are simple wildcards rather than regular expressions)

    Robocopy ships with recent versions of windows & can do everything that xcopy can, it supports /xd to exclude directories.