中国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 03:36
48,037 topics / 350,122 posts / today 2 new / 48,250 members
DOS批处理 & 脚本技术(批处理室) » Why are all the error codes returned by del 0?
Printable Version  1,359 / 3
Floor1 zhoung0 Posted 2006-09-19 13:41
初级用户 Posts 18 Credits 54
Delete a 11.txt
F:\>del 11.txt /p
F:\11.txt, Do you want to delete (Y/N)? y
F:\>echo %ERRORLEVEL%
0

---------------------------------------
Delete a non-existent 12.txt
F:\>del 12.txt
File F:\12.txt not found
F:\>echo %ERRORLEVEL%
0

--------------------------------------
Delete a file without permission
F:\>del c:\ntdetect.com
c:\NTDETECT.COM
Access denied.
F:\>echo %ERRORLEVEL%
0

That's it. What's going on?
Floor2 vkill Posted 2006-09-20 00:13
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
I don't know the return value of del, but deltree only returns 0
Floor3 namejm Posted 2006-09-20 00:46
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Not every command has a return value, maybe del doesn't either.
Floor4 amao Posted 2006-09-20 17:37
中级用户 Posts 152 Credits 316
DEL is an internal command, and there should be no return value, so it's all zero.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023