0

I have all Ms office, Doc, xls, ppt, file scatter all over in different directories on my external hardrive I would like to move them to one director all *.doc & *.docx in a word directory with a sub directory where the come from *.xls & *.xlsx in a excel directory with a sub directory where the come from same with all the other types of MS office documents

In c:\ I create a directory c:\msdoc\ Under the msdoc instead of manually create a sub-directory the batch file create automatically the sub directory where the files come from

say I have file in c:\afiles\minopex then the batch file should create under c:\msdoc\ the sub-directory minopox and move all the *.doc to the new location the same for all other type of files

How can i write a batch file to do this

1 Answers1

0

you can - use a for loop with /r for recursivly parsing a directory - use %%f in collection (e.g. *.xls) to grab the files from the for loop - use the move-command to move files to a specific directory.

so for doc files it would be a one liner, for xls you could use a second line and so on...

Offler
  • 270
  • 1
  • 2
  • 14