|
![](/i/fill.gif) |
Under Unix, if you say
rm file1
it deletes the specified file. If you say
rm folder1
it deletes the specified folder. So far so good, eh?
Now consider CMD.EXE, the Windows NT command processor. If you do
DEL file1
it deletes the specified file. If you now say
DEL folder1
it asks you "are you sure?". If you add the /Q switch, it will just
delete the folder... hahaha! No, it won't. Actually, it merely deletes
the /contents/ of the folder. Actually, you know what? No it doesn't. It
deletes the /files/ within the folder. Unless you add /S (recursive
delete), in which case all files in all folders are deleted, but the
folders themselves remain.
In order to /actually/ delete a folder, you must do
RMDIR folder1
Oh, but that fails if the folder is not empty, so you must add /S. Oh,
but that asks for confirmation, so you must add /Q as well.
Short version: To delete an object, you must know whether it is a file
or a folder. Thanks for that... :-P
Special bonus for failing to document this fact anywhere. (E.g., the
manual for DEL doesn't mention that there's an RMDIR command.)
Post a reply to this message
|
![](/i/fill.gif) |