中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-09 18:00
47,811 topics / 349,896 posts / today 1 new / 48,254 members
DOS批处理 & 脚本技术(批处理室) » Question about excluding special directories and files when copying files
Printable Version  923 / 13
Floor1 iipiip Posted 2008-09-04 16:12
新手上路 Posts 7 Credits 16
--output
--projects
--project1
--bin
--debug
project1.dll
project1.xml
--release
project1.dll
project1.xml
--obj
--debug
project1.dll
project1.xml
project1.pda
--release
project1.dll
project1.xml
--project2
--bin
--debug
project1.dll
project2.dll
project2.xml
--obj
--debug
project1.dll
project1.xml
project1.pda
..............
The output folder and the projects folder are at the same level. Inside the projects folder there are multiple project folders . Each project folder has a bin folder and an obj folder, and inside the bin folder and obj folder there are debug and release folders. Now I want to copy the contents of the debug folder inside the bin folder into output, but not the ones in obj. Also, because project2 also has a file called project1.dll, I need to skip that file. This batch file is too hard for me. Please give me a hand.

[ Last edited by iipiip on 2008-9-4 at 04:14 PM ]
Floor2 iipiip Posted 2008-09-04 16:17
新手上路 Posts 7 Credits 16
It should be copying the *.dll and *.xml files from the debug folder inside the bin folder into the output folder
Floor3 HAT Posted 2008-09-04 16:32
版主 Posts 5,017 Credits 9,023
Do you mean this?
Floor4 HAT Posted 2008-09-04 16:33
版主 Posts 5,017 Credits 9,023
Uh, the requirements changed.
Floor5 iipiip Posted 2008-09-04 16:40
新手上路 Posts 7 Credits 16
Thank you so much................................
Floor6 iipiip Posted 2008-09-04 16:44
新手上路 Posts 7 Credits 16
But I still have one more question. Right now project2 comes after project1. If project2 comes before project1, then the dll inside project1 won't overwrite project2's, right? What I mean is, the one coming out of the project1 folder, and then the ones from other folders, should not overwrite it. Can this be done? Sorry to trouble HATle again

These dll names are definitely the project names,
Floor7 HAT Posted 2008-09-04 16:49
版主 Posts 5,017 Credits 9,023
The results of dir should be sorted in ascending order by default, so project1 is automatically placed before project2.
echo n is exactly so the later ones won't overwrite the earlier ones.
Floor8 iipiip Posted 2008-09-04 16:52
新手上路 Posts 7 Credits 16
Uh... the problem is, project1 may not be called project1... I'm just writing it like this for convenience. It could be wpfproject, and project2 could be sileverlightproejct....
Floor9 HAT Posted 2008-09-04 16:55
版主 Posts 5,017 Credits 9,023
Strings are sorted according to ASCII codes
wpfproject will come after sileverlightproejct
Do you mean you want wpfproject to come before sileverlightproejct?
Floor10 iipiip Posted 2008-09-04 17:03
新手上路 Posts 7 Credits 16
Uh... let me put it this way. It's still the same file structure as above, except that the debug folder under project1 has project2.dll
project1
--bin
--debug
project1.dll
project1.xml
project2.dll
--project2
--bin
--debug
project2.dll
project2.xml
What I mean is, when copying, the contents of the debug folder under project1 will definitely be copied first, so then output will have project2.dll, and when project2 gets copied later, it won't overwrite project2.dll. But what I need is for project2.dll inside project2 to overwrite the project2.dll in output. Because project2.dll is produced by the project2 folder. I don't know if you understand what I mean~。~ Thanks again for your help. Thank you
Floor11 HAT Posted 2008-09-04 17:27
版主 Posts 5,017 Credits 9,023
Floor12 iipiip Posted 2008-09-04 17:28
新手上路 Posts 7 Credits 16
Still thanking you................
HAT is a super nice person
Floor13 sparklt Posted 2008-09-05 22:13
初级用户 Posts 15 Credits 22
Same here, a modern-day Lei Feng
Floor14 406317577 Posted 2008-09-06 01:59
初级用户 Posts 45 Credits 98
A bit complicated
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023