Wildcard file extensions xcopy
Solution 1
In your command line:
xcopy /C /D /Y /I "C:\Temp\Source" "C:\Temp\Destination"
as far as I can see, you haven't told xcopy what to copy. If you're trying to copy everything in C:\Temp\*.* then try:
xcopy C:\Temp\*.* C:\Temp\Destination\ /C /D /Y /I
Solution 2
Use robocopy
instead of XCOPY. It supports the same options and allows to select file patterns:
robocopy source dest file(s) [options]
For file pattern you could use ?
for any single character, *
for zero to multiple chars and so on. It would help if you gave an example of how the extensions are looking like.
Related videos on Youtube
![Worthwelle](https://i.stack.imgur.com/6Ou94.png?s=256&g=1)
Worthwelle
I am a software engineer and system administrator looking to help out others. If I've saved you time or money with an answer and you feel generous, feel free to buy me a coffee. It's certainly not expected, but is greatly appreciated.
Updated on September 18, 2022Comments
-
Worthwelle almost 2 years
I have some files that need to be copied to a directory on a schedule. All the files have the same name but the extension increments (I have no control over this, it drives me mad)
I've tried running
xcopy /C /D /Y /I "C:\Temp\Source" "C:\Temp\Destination"
But I get a message it can't find the file.
Right now I've got a bit of a bodge in place that uses an excluded file extension list and copies anything that isn't in the list but I feel like it might be able to be done better.