中国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-12 07:57
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Help] Delete and recreate a folder and the files in it
Printable Version  742 / 1
Floor1 dg831451 Posted 2010-07-08 11:36
新手上路 Posts 7 Credits 8
I want to use a batch file to do something like this:

For example, on drive D there is a folder called “My Documents”

Under this folder there are many files. But they are all EXCEL files. For example, 1月.xls 2月.xls 3月.xls

So I want to use a batch file to delete this folder and everything under it. After deleting it, automatically create a folder again. The folder name should be the same as before, “My Documents” After the folder is created, also recreate the files in the folder the same as before deletion, such as 1月.xls 2月.xls 3月.xls (of course the recreated ones are empty files. What I really mean is to use a batch file to delete them and then recreate the same folder and files as before. Please help me with this. This job has to be done every month. Doing them one by one is too slow.

After the folder is created, finally display a message: " File deletion complete. The new folder and files have been created successfully" After this message appears for 15 seconds, the dialog box should disappear automatically.
Floor2 cad55 Posted 2010-07-08 16:43
高级用户 Posts 329 Credits 620
There's no need to use BAT

For what the OP wants, a RAR archive is enough,

Pack them into one archive, and when needed just extract it.................
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023