中国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-02 04:43
48,037 topics / 350,122 posts / today 2 new / 48,250 members
DOS批处理 & 脚本技术(批处理室) » Here comes another path problem.
Printable Version  1,612 / 8
Floor1 xg911335 Posted 2006-09-20 01:28
初级用户 Posts 50 Credits 134
How to make the command delete files only in the current path of the drive letter without entering other directories and subdirectories?
Floor2 squareqwer Posted 2006-09-20 01:33
新手上路 Posts 5 Credits 9
for %%i in (c d) do del /q %%i:\1.log
Floor3 vkill Posted 2006-09-20 03:59
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
for %%i in (%cd%) do del /s/q %%i:\1.log
Floor4 xg911335 Posted 2006-09-20 06:29
初级用户 Posts 50 Credits 134
Thanks to the first two friends.
I just want to delete the problem in the root directory, not to search other directories and subdirectories.
How to set %cd%?

[ Last edited by xg911335 on 2006-9-20 at 06:51 ]
Floor5 vkill Posted 2006-09-20 07:19
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
Floor6 kcdsw Posted 2006-09-20 07:39
中级用户 Posts 179 Credits 404
You should go and check the help of these commands. It will be mentioned above.
Floor7 pengfei Posted 2006-09-20 08:19
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
The friend on the second floor has already provided the code. The code of the original poster added the /s parameter, so it will delete the matching files in the subdirectories.
Floor8 xg911335 Posted 2006-09-21 09:20
初级用户 Posts 50 Credits 134
Floor9 namejm Posted 2006-09-21 09:25
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Adding the parameter `/a` to `del` to delete all attribute folders is relatively perfect.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023