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-06-26 19:17
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch delete multiple folders View 2,876 Replies 4
Original Poster Posted 2017-09-21 12:45 ·  中国 湖北 武汉 移动
新手上路
Credits 8
Posts 8
Joined 2017-08-21 22:22
8-year member
UID 182480
Gender Male
Status Offline
@echo off
title Batch Delete Multiple Folders
rem Only display directories dir /a /d /b
set rdpath=
echo,
echo,+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo,Input format for deleting a single folder: c:\home
echo,Input format for deleting multiple folders: d:\*.*,d:\1,d:\2 Separate folders with commas
echo,If there are spaces in the folder, use English double quotes "" to enclose, e.g., "c:\my home", otherwise an error will occur
echo,+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo,
set /p rdpath=Please enter the folder(s) to delete:
echo,
for /d %%i in (%rdpath%) do (
if exist %%i (rd /s /q %%i &echo -Deleted folder %%i) else (echo *Folder %%i does not exist)
)

echo,
title
pause
Floor 2 Posted 2017-09-21 13:22 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 3 Posted 2017-09-21 13:26 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Is there any introductory popular science textbook on Chinese character sets?
1<词>,2,3/段\,4{节},5(章)。
Floor 4 Posted 2017-09-21 13:38 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Can batch processing display the smallest resolution dot on the screen?
1<词>,2,3/段\,4{节},5(章)。
Floor 5 Posted 2017-09-21 13:56 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
I saved the batch processing as a text, modified the folder hidden option, and changed it to the bat suffix.
I created a folder 1 under C:\.
When running the bat, entering c:\1 can delete it.
But when I added a >1.txt later, it didn't succeed, and I wanted to output the execution content to a text.
Adding | also didn't work.

[ Last edited by zzz19760225 on 2017-9-21 at 14:03 ]
1<词>,2,3/段\,4{节},5(章)。
Forum Jump: