I'd like to use the XCOPY command to copy files. I need to skip files with specific extensions. From the help screen, it looks like XCOPY would work.
Microsoft’s help says….
Using /exclude
List each string in a separate line in each file. If any of the listed strings match any part of the absolute path of the file to be copied, that file is then excluded from the copying process. For example, if you specify the string "\Obj\", you exclude all files underneath the Obj directory. If you specify the string ".obj", you exclude all files with the .obj extension.
I have the following
C:\exclude.txt
Contents of exclude.txt
*.zip
*.lck
*.fpc
C:\test has four files
One.lck
Two.lck
Three.lck
Yescopy.txt
C:\copytest is an empty directory
My command line
Xcopy c:\test\*.* c:\copytest /exclude:c:\exclude.txt
When I run this command, all four files from test are copied to copytest
When I get the solution, the command will go into a batch file to be scheduled to run nightly. The rest of the big job works perfectly so I don't want to re-invent the wheel and go into a new direction with this. My dad says I'm stubborn so I suppose I also want to just figure this exclude thing out.
Thanks in advance for your help.
Microsoft’s help says….
Using /exclude
List each string in a separate line in each file. If any of the listed strings match any part of the absolute path of the file to be copied, that file is then excluded from the copying process. For example, if you specify the string "\Obj\", you exclude all files underneath the Obj directory. If you specify the string ".obj", you exclude all files with the .obj extension.
I have the following
C:\exclude.txt
Contents of exclude.txt
*.zip
*.lck
*.fpc
C:\test has four files
One.lck
Two.lck
Three.lck
Yescopy.txt
C:\copytest is an empty directory
My command line
Xcopy c:\test\*.* c:\copytest /exclude:c:\exclude.txt
When I run this command, all four files from test are copied to copytest
When I get the solution, the command will go into a batch file to be scheduled to run nightly. The rest of the big job works perfectly so I don't want to re-invent the wheel and go into a new direction with this. My dad says I'm stubborn so I suppose I also want to just figure this exclude thing out.
Thanks in advance for your help.