Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Could someone please explain step by step how to delete a file using DOS prompt. (I have a number of bitmap files..they are not "read only".. that I cannot delete in the usual way. Thanks

Why can't you delete them in Windows?
To delete a file in DOS, go to the directory the file resides, and type:
DEL FILE.EXT

If they're not read only you should be able to delete them in windows. But anyway, you need to find the directory the files are in.
Folders in windows is the same as directories in dos. Exiting windows leaves you in the c:\windows directory. Cd\ at the prompt always takes you to the root directory of the drive you're in, where cd stands for change directory. Cd.. takes you to a directory one level lower. For example, if you're in c:\dir1\dir2\dir3 then cd.. will take you to c:\dir1\dir2. Cd will take you one level higher. For example if you're in c:\dir1 then cd dir2 will take you to c:\dir1\dir2. Now that that's crystal clear(?) deleting them is easy.
Once you're in the correct directory, just type del and then the file name. If you want to delete file.bmp then type del file.bmp. If you want to delete all the .bmp files in that directory then type del *.bmp. If you get a read only error then you'll need to remove the read only attribute first. Type attrib -r file.bmp to remove the read only attribute from file.bmp. Then you can delete it.

To erase a file in windows from windows explorer right click the file and select properties then unclick the readonly box. Now you can just delete.
To remove the attributes in dos type: attrib -r.
Then to delete a file in dos type:
erase c:\windows\system\filename.exe
Or change the path to the directory where the file is and type: erase filename.exe
This is just an example.

Gus, there is one thing that seems to be missing from all this advice:
Windows supports long file names; Dos does not. So a file (or folder) named MyPersonalFiles.txt in Windows will be truncated to eight characters in DOS, that is :
MyPers~1.txt
While MyPersonalFolders.txt will become MyPers~2.txtBear this in mind when trying to locate files/Directories in DOS.
Don

I have another suggestion in case the above doesn't work.
Make a temporary folder. Move all the files to this folder. Go to Dos and then to this folder (make sure you are in the right folder) and type del *.* This will delete all the files in the folder so don't make a mistake!

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |