0

Here is how I am creating and using the exclude file list:

:: Pull out parameters
set srcDir=%1 
set destDir=%2

:: Create exclude file
Set excludeFile=%temp%\exclude_list.txt

:: Populate exclude file
Echo.%srcDir%\web.config > %excludeFile%
Echo.%srcDir%\bin\*.* >> %excludeFile%
Echo.%srcDir%\custom\*.* >> %excludeFile%
Echo.%srcDir%\dataentry\custom\*.* >> %excludeFile%
Echo.%srcDir%\images\custom\*.* >> %excludeFile%

:: do a robust copy from source to dest
robocopy %srcDir% %destDir% /e /xf %excludeFile%

But none of this stuff is excluded in the final copy; am I doing something wrong?

LynchDev
  • 793
  • 1
  • 12
  • 27

2 Answers2

1

The /XD and /XF options expect a list of paths to exclude, not the name of a file containing paths to exclude.

:: Pull out parameters
set srcDir=%1
set destDir=%2

:: do a robust copy from source to dest
robocopy %srcDir% %destDir% /e /xd .\bin .\custom .\dataentry\custom .\images\custom /xf .\web.config

I believe you need to use the /JOB or /IF option if you want to specify parameters in another file, though I haven't used those options.

dbenham
  • 127,446
  • 28
  • 251
  • 390
0

Have you considered using xcopy? With it you can make an exclusion list, and it works very well.

mjgpy3
  • 8,597
  • 5
  • 30
  • 51