Link to home
Start Free TrialLog in
Avatar of dmctighe
dmctighe

asked on

copy files

Over the last few years I have been allowing my users to store jpg's in any directory they want on our server(windows 2003).  Now I have a problem with storage and am going to implement a policy to only store jpg's in one directory.  I am also going to use some software that will restrict putting files in the directory.  My question is this:  I am wondering if there is a way to copy all the JPG's from one directory to another and keep the directory structure(ie I have a folder called c:\server\project2003\"project number"  there is about 200 "project number" folders - each with a bunch of JPG's in them). When I copy all these files to a single directory I would like it to copy the directory structure also so I know which project the JPG is for.  Any ideas??


thanks
derek
Avatar of Intense_Angel
Intense_Angel

I like to use this program, you can sort with a wild card *.jpg and then duplicate to another directory.  Works great.

http://www.foldermatch.com/
you can use the XCOPY command.
this will copy the files with the folder structure
haim96....you tailing me today? :-)  If he uses xcopy won't that copy all other files withing the directories also?  I am assuming that others exist because he didn't copy and paste.  
ASKER CERTIFIED SOLUTION
Avatar of haim96
haim96

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mohammed Hamada
Hello Dmctighe..

Enter to each folder, select all the JPG's and right click on one of them while they are selected...
For example If you have pictures that seriesed as the following DSC06315 - DSC06316 .... 17 ... 100 in folder one.

And you have another folder that has the pics -- GSC06315 ... GSC06999...

To Copy both JPGs in both folders to one Directory, Select all in the first folder, right click one of them and rename it " Don't delete the original name, Type After the original Name
" Folder one " exculding quotes... this will rename the whole JPGs in this folder to  DSC06315 - Folder One .... DSC0617 - Folder ONe.... etc

The same procedures should be done to the next done, then you can copy all of them to the same directory and see which belong to which folder.

Hope This helps.
angel... if he will use wild card it will copy only JPG files.
best practice will be to create target folder like c:\jpgfolder
then run :
xcopy d:\*.jpg /s c:\jpgfolder\

note that the target folder should be on difrent drive from the one you copy from.
after that you can move the target folder to what ever you want to.
Try to use "Total Commander" it's free to use and have anything you want. That's a wonderfull software.
use xxcopy (that is xxcopy, not xcopy), it allows intermediate wildcards in the path.

xxcopy c:\server\project2003\*\*.jpg  D:\destination\*\ /s/a

That will xxcopy in a single command ALL the project directories to the destination and clone the project directories under that new path, copying only the JPGs, in my command line example.  See www.xxcopy.com
of course, you could also use xcopy if you didnt want to be selective in files -

xcopy c:\server\project2003\  D:\newdir\ /s/c/k

it will do the same thing, but you cannot select only a certain file type or structure under the *.
scrathcyboy , yes he can !
and i have tested my self before post that !
and sine he want to keep folder structure all he need is :
xcopy d:\*.jpg /s c:\targetfolder\
or
xcopy d:\server\*.jpg /s c:\jpgfolder\

the command search the folder for jpg files
and copy them with folder structure,no other files will be copy !