TechSpot

Copying files via batch files

By Sam23
Mar 26, 2009
Topic Status:
Not open for further replies.
  1. Hello
    I want to make a batch file which will copy the files from directory and its sub-sub-directory & put into other directory with no sub-directory.Please help me.
    Advance thanks for the solutions
  2. lopdog

    lopdog TS Maniac Posts: 378

    Does it have to be a batch file? If you're running XP or Vista you could just open the directory containing files and subdirectories, and do a search for *.*
    That should show all files (and folders) in the current directory. Sort by type, select the files you need and copy them all to another directory.
  3. gbhall

    gbhall TechSpot Chancellor Posts: 2,344   +49

    Try using XCOPY in your batch file, with parameter /s and /e also if you want the directory sub-structure copied as well, even if empty. Start windows help and key XCOPY for a list of all the (many) parameters supported. This is XP. Neither know nor care if it is still there in Vista
  4. lopdog

    lopdog TS Maniac Posts: 378

    You could also try ROBOCOPY (if you are running Vista)
    Read more at http://en.wikipedia.org/wiki/Robocopy.
  5. Sam23

    Sam23 TS Rookie Topic Starter

    Hi
    Thanks for ur solutions but i did with for loop

    Thanks i did with for loop
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.