Discussion:
del command and auto-named file disaster
(too old to reply)
Deniz
2009-08-05 22:25:36 UTC
Permalink
OK maybe I should have known better, but I still believe this should
be avoidable in OS/FS level.

As you know Windows file system names the copy of a file as "Copy of
FILENAME" by default. When I need to update an important file, I
simply create a copy and work on the original. If anything goes bad, I
still have the original file "Copy of FILENAME". If everything works,
I don't need the duplicate so I delete the copy. This works perfectly
until I delete the file in command line without quotes!
dir
FILENAME
Copy of FILENAME
del Copy of FILENAME
Can you guess which file has been deleted? Hint: Delete command looked
for 3 files, not one. (hand-palm)

Lesson learned in a hard way. To avoid future disasters, is there
anything I can do e.g. a Windows tweak that allows Delete command to
send the file to Recycle Bin instead of wiping completely? Or making
Delete prompt me by default? Or even more hardcore, changing the
default auto-naming convention?

Thanks in advance.
Pegasus [MVP]
2009-08-06 05:36:45 UTC
Permalink
Post by Deniz
OK maybe I should have known better, but I still believe this should
be avoidable in OS/FS level.
As you know Windows file system names the copy of a file as "Copy of
FILENAME" by default. When I need to update an important file, I
simply create a copy and work on the original. If anything goes bad, I
still have the original file "Copy of FILENAME". If everything works,
I don't need the duplicate so I delete the copy. This works perfectly
until I delete the file in command line without quotes!
dir
FILENAME
Copy of FILENAME
del Copy of FILENAME
Can you guess which file has been deleted? Hint: Delete command looked
for 3 files, not one. (hand-palm)
Lesson learned in a hard way. To avoid future disasters, is there
anything I can do e.g. a Windows tweak that allows Delete command to
send the file to Recycle Bin instead of wiping completely? Or making
Delete prompt me by default? Or even more hardcore, changing the
default auto-naming convention?
Thanks in advance.
Windows Explorer has a GUI. It is designed for users and has the safety net
of the Recycle Bin.

The console is for administrators, not for users. It has no safety net. When
you delete a file then it gets well and truly deleted. If you need a safety
net then you must use Windows Explorer.

Loading...