Super User is a question and answer site for computer enthusiasts and power users. 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 need a batch file to find all of my *.sql file in specefic folder and its subfolder like "c:\aaa\" and by using xcopy copy the latest version of them on other folder like "c:\bbb\"

would you help me?

I use windows xp.

share|improve this question
up vote 1 down vote accepted

Try this in your command prompt:

C:\>for /R c:\aaa %G IN (*.sql) DO xcopy "%G" C:\bbb\

It recurses through c:\aaa\ and its subfolders and copies the found *.sql files to c:\bbb (without the original folder structure).

share|improve this answer
Thanks bro,work fine – rima Dec 10 '10 at 9:46

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.