Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been searching for a way to resolve this issue but can't find the right way. I have 3000 folders and need to extract a file out of each. It's slightly more complicated than that because of the file path which I have put below.

p:/asset management/planned maintenance/property file/3000 different property folders/06. asbestos/THE FILE I WANT TO EXTRACT.pdf

I have seen solutions to similar problems on here but none seem to fit what I'm trying to do here as they all have a slightly different file structure. They all seem to be C:/music/lots of files/mp3s (for example)

Any help would be greatly appreciated!



share|improve this question
Do you know powershell? Or any other scripting language? – Tom Feb 1 '12 at 9:34
In addition to @Tom's question, when you say extract, I assume you mean simply "copy", rather than extracting from a compressed file? – Dan Feb 1 '12 at 10:50

If you need to do this only once you might use windows build in file find to get a list, then select them all and copy them. I do not recommend this as a daily task :)

If you have the unix find command you could do some like this:

find p:/asset management/planned maintenance/property file/ -name THE FILE I WANT TO EXTRACT.pdf -exec cp {} p:\Dir_I_want_them_copied_to \;

This makes find look at all files in p:/asset management/planned maintenance/property file
It only selects the files named THE FILE I WANT TO EXTRACT.pdf
-exec is then used to execute a command rather than list the files.

Caveeat: There is a FindUtil for windows package. However I did not test it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.