I have several files of different kinds in different folders and subfolders. They are huge in number. I am looking to extract all the files from all locations and copy to a single directory.
I wrote a Python script as follows, [for .doc file only], but is taking too much of time.
import os
from fnmatch import fnmatch
def listallfiles1(n):
root = 'C:\Cand_Res'
pattern = "*.doc"
for path, subdirs, files in os.walk(root):
for name in files:
if fnmatch(name, pattern):
print os.path.join(path, name)
If you may suggest some smart solution either by using any Windows feature, or any MS-DOS command etc. or Python script.