Copying files via batch files

Status
Not open for further replies.
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
 
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.
 
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
 
You could also try ROBOCOPY (if you are running Vista)
robocopy, or "Robust File Copy", is a command-line directory replication command. It was available as part of the Windows Resource Kit, and introduced as a standard feature of Windows Vista and Windows Server 2008.

Robocopy is designed for reliable mirroring of directories or directory trees. It has features to ensure all NTFS attributes and properties are copied, and includes additional restart code for network connections subject to disruption.
Read more at http://en.wikipedia.org/wiki/Robocopy.
 
Status
Not open for further replies.
Back