First, thanks to Climbing for introducing me to such a good place. I didn't even know there was a China DOS Union before, so I hope the veterans here won't mind. Knowledge about DOS is getting less and less now, and this place really lets us review the old and learn the new.
Enough small talk, I want to ask a question, one I've never been able to solve.
> --------------------------------------
> 1. Create a directory on drive C called TBLBAK; if it already exists, don't create it. Then create a directory inside TBLBAK named after the date
(or it can be named some other way too)
> 2. Copy c:\faspic\tbl*.* to C:\tblbak\ previously created directory\.
> 3. Overwrite-copy a:\tbl*.* to c:\faspic\.
> 4. Check whether the directories created by this batch file under c:\tblbak exceed 10. If they do, delete the earliest
created one, i.e. keep at most the latest 10 directories.
> 5. Can one batch file carry out all the above operations? Of course, temporarily created batch files can be ignored.
>
> ---------------------------------------------
There are several difficult points:
1. How do I create a directory name based on the date that DOS can recognize? That is, the year can only take the last few digits; if it goes beyond that, DOS won't recognize it?
2. How do I detect whether those directories it created have already exceeded 10? Or some user-defined number?
3. How do I intelligently delete the earliest-created one while always keeping 10?
4. Aside from temporarily created batch files, how feasible is it to have one batch file do all this?
5. I'm not very capable, so I hope all you experts can lend me a hand and help me out.
Enough small talk, I want to ask a question, one I've never been able to solve.
> --------------------------------------
> 1. Create a directory on drive C called TBLBAK; if it already exists, don't create it. Then create a directory inside TBLBAK named after the date
(or it can be named some other way too)
> 2. Copy c:\faspic\tbl*.* to C:\tblbak\ previously created directory\.
> 3. Overwrite-copy a:\tbl*.* to c:\faspic\.
> 4. Check whether the directories created by this batch file under c:\tblbak exceed 10. If they do, delete the earliest
created one, i.e. keep at most the latest 10 directories.
> 5. Can one batch file carry out all the above operations? Of course, temporarily created batch files can be ignored.
>
> ---------------------------------------------
There are several difficult points:
1. How do I create a directory name based on the date that DOS can recognize? That is, the year can only take the last few digits; if it goes beyond that, DOS won't recognize it?
2. How do I detect whether those directories it created have already exceeded 10? Or some user-defined number?
3. How do I intelligently delete the earliest-created one while always keeping 10?
4. Aside from temporarily created batch files, how feasible is it to have one batch file do all this?
5. I'm not very capable, so I hope all you experts can lend me a hand and help me out.



