Copying files with name containing just numbers using a batchfile

I have a Directory with a deep Directory->Sub-directory tree structure. I need to write a batch file to copy all the numbered files (files with names as digits and no alphabetic characters) from all the sub-directories.

For example, a sub-directory might contain the following files:

  • WR10091.txt
  • AX10091.htm
  • 10091.txt
  • AX10091.xml
  • 10091.xml

I need to copy 10091.txt and 10091.xml to another location. I can copy files like AX10091.xml and AX10091.htm by specifying AX*.*. But I cannot figure out how to copy just numbered files with no alphabetic characters. There are thousands of directories and the directory structure does not have any pattern (the depth of a tree branch can vary considerably).

Any help will be appreciated.


Source: windows

Leave a Reply