China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-03 18:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Copy a file to the root directories of all specified disks, and it cannot be deleted View 2,349 Replies 19
Original Poster Posted 2007-03-02 00:39 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
I read (Essence I: Batch Processing Room Classic Post Classification Index) and saw the part about copying a file to many folders (with patterns). Now I want to ask, can I copy a specified file to all folders on a specified drive?

[ Last edited by namejm on 2007-3-1 at 06:29 PM ]
Floor 2 Posted 2007-03-02 00:45 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
dir /s /b /ad D:
This will get all folder paths, and it can be handled with for.... Is it for doing something bad?
Floor 3 Posted 2007-03-02 00:47 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
Why do people always think about doing bad things? Coming here is originally for discussion. Learning some new things, right? So no matter what, as long as there is a kind heart, one won't do bad things.
Floor 4 Posted 2007-03-02 00:53 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Aren't I the one who told you? But do you think it's generally necessary?

desktop.ini? Configuration folder background?
Floor 5 Posted 2007-03-02 05:39 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
Thanks to the guidance from the person above, I have completed it.
for /f %%i in ('dir /s /a /b /ad e:.') do (copy 99.bat %%i\)
Floor 6 Posted 2007-03-02 05:44 ·  中国 辽宁 本溪 联通
银牌会员
★★★
Credits 1,212
Posts 464
Joined 2006-12-13 21:11
19-year member
UID 73417
Gender Male
Status Offline
Even if it's copied to each folder, it doesn't matter. It can be deleted by searching, so there's no real harm... Personal opinion :)
Floor 7 Posted 2007-03-02 06:01 ·  中国 四川 绵阳 江油市 电信
高级用户
★★★
Credits 502
Posts 327
Joined 2006-12-30 06:01
19-year member
UID 74981
Gender Male
Status Offline
Methods are neutral, people are kind, and being eager to learn is always right
Floor 8 Posted 2007-03-02 06:22 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
Then continue to think, is there a method that can't be deleted. Haha
Floor 9 Posted 2007-03-02 06:28 ·  中国 江苏 苏州 联通
银牌会员
★★★
Credits 1,181
Posts 533
Joined 2006-08-14 12:54
19-year member
UID 60484
Status Offline
Why can't it be deleted?
Floor 10 Posted 2007-03-02 07:10 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
Use system processes and the like, anyway, it's forbidden to access. I don't know either, just see if experts have good methods and tips, let's think together, everyone.
Floor 11 Posted 2007-03-04 08:25 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
Why is there no expert to give guidance?
Floor 12 Posted 2007-03-04 08:52 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
Please help everyone. The attachment is to copy files to all subdirectories of drive D. But after running the BAT, it will display copying a file. How to make this prompt not show? Please give your advice from all friends. Thank you in advance here.
Attachments
复制文件到子目录下.rar (225 bytes, Credits to download 1 pts, Downloads: 37)
Floor 13 Posted 2007-03-04 09:39 ·  中国 浙江 绍兴 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
Hehe, I also thought about using BAT before, but this is too easy to be discovered and doesn't work. Advanced viruses need file protection instead of hiding. Even if you find the file, you can't delete it.
Floor 14 Posted 2007-03-04 19:41 ·  中国 天津 联通
新手上路
Credits 5
Posts 2
Joined 2007-02-25 16:17
19-year member
UID 80150
Gender Male
Status Offline
Thanks
Floor 15 Posted 2007-03-07 05:28 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
I come to top again, haha. And then ask the experts to help solve it, haha
Forum Jump: