|
Answer» I need to move a bunch of xml files from one dir to another then select about 500 of them and copy them back to the original directory. Here is what I have so far:
REM NAVIGATE INTO THE DATA DIRECTORY CD C:\Program Files\Numara Software\Track-It! 7.0\Track-It! Server\DATA
REM MOVE ALL THE XML FILES TO THE TEMP DIRECTORY MOVE /y *.XML .\Temp
REM NAVIGATE TO THE TEMP DIRECTORY cd temp
REM CREATE A TXT FILE LIST OF ALL XML FILES IN THE TEMP DIRECTORY dir /B *.xml > FullList.txt
REM SHORTEN LIST TO 500 {~?~?~?~?~?~?~~?~?~}
REM COPY BACK FILES ACCORDING TO 500 LIST {~?~?~?~?~?~?~~?~?~}
Problably need to create a loop to go through the list and copy files with a varible that increases by one upon each loop. Once the varible hits 500 the copy process ends and I have my 500 files.
Can you help??? ThanksFirst of all, batch files USE REM for comments, not the '.
Next, I think it can be done, but I'd have to know: On what basis should the list be shortened to 500? On file name? Size? LAST Modified?
The rest is surprisingly easy to do.Doesnt matter which are copied over first. Eventually all will be but, the problem is the program that uses these files can only use a max of 500 at a TIME or the app blows up. This is why I have to put the over flow into a temp until the previous 500 have been processed.Okay, I'm getting to work on this now. I can't say how long it'll take, but I doubt it'll take too long.
EDIT: Running into a little trouble. I'm trying to find a way to count how many files have been copied. Not going well. Also, having trouble getting the darn thing to copy the files if I don't know the file name.
I know this can be done, but I don't think I'll be able to do it right now.I'm pretty new to this to, but if the problem is just the number it can handle when you move them back could you do something like just moving them back up in GROUPS based on name?
was thinking something like this:
move /y a*.xml c:\...\location\... move /y b*.xml c:\...\location\... move /y c*.xml c:\...\location\...
might be a lot of extra lines but i think it would do what you need. I'm sure there is an easer I just don't know it yet.
Good LUCK! Casey242Code: [Select]CD C:\Program Files\Numara Software\Track-It! 7.0\Track-It! Server\DATA should be Code: [Select]CD "C:\Program Files\Numara Software\Track-It! 7.0\Track-It! Server\DATA", right?
|