Is there an MS-DOS command that allows me to delete all files except one?
Consider as an example the following files:
a.001
a.002
a.003
a.exe
a.c
Is there a command to delete all files except a.c?
|
Is there an MS-DOS command that allows me to delete all files except one? Consider as an example the following files:
Is there a command to delete all files except
| ||||
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
You can use the
This goes through the current directory, and compares each file name to a.c. If it doesn't match, the file is deleted. | |||||||||||||
feedback
|
|
No, there isn't. I'd make a directory, copy the important file into it, erase ., and move the file back. Then delete the temp file.
| |||||
feedback
|
|
You could set the file to read only before deleting everything
| |||
|
feedback
|
| |||||||||||
feedback
|
| ||||
|
feedback
|
|
| |||||||
|
feedback
|