I want to copy files and folders in a directory to another folder excluding a list of files and folders.Is that possible.
I was just trying to copy excluding file :
xcopy c:\t1 c:\t2 /EXCLUDE:exclusion.txt
But it keeps saying read cant read file : exclusion.txt
Can anyone help me on this?
Thanks
xcopy cannot be configured to SKIP existing files, so you should copy using "robocopy".
Press F if you want the file or files to be copied to a file. Press D if you want the file or files to be copied to a directory. You can suppress this message by using the /i command-line option, which causes xcopy to assume that the destination is a directory if the source is more than one file or a directory.
To do so, run the Xcopy command with /T switch. Using the /T switch will cause Xcopy to copy only the directory tree structure to the destination but ignores the empty directories. You can also add the /E switch to the command to include empty directories, as shown in the example command below.
MS-DOS and Windows command line By default, the basic xcopy command only copies files in the directory you specify as the source directory. You must use the /E option to copy subdirectories in the source directory as well.
Just give full path to exclusion file: eg..
-- no - - - - -xcopy c:\t1 c:\t2 /EXCLUDE:list-of-excluded-files.txt
correct - - - xcopy c:\t1 c:\t2 /EXCLUDE:C:\list-of-excluded-files.txt
In this example the file would be located " C:\list-of-excluded-files.txt "
or...
correct - - - xcopy c:\t1 c:\t2 /EXCLUDE:C:\mybatch\list-of-excluded-files.txt
In this example the file would be located " C:\mybatch\list-of-excluded-files.txt "
Full path fixes syntax error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With