Computing.Net > Forums > Windows 95/98 > How to delete file using DOS prompt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to delete file using DOS prompt

Reply to Message Icon

Name: Gus
Date: January 29, 2002 at 16:54:21 Pacific
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: radon
Date: January 29, 2002 at 16:57:22 Pacific
Reply:

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


0

Response Number 2
Name: DAVEINCAPS
Date: January 29, 2002 at 17:13:11 Pacific
Reply:

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.


0

Response Number 3
Name: Buster
Date: January 29, 2002 at 17:13:40 Pacific
Reply:

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.


0

Response Number 4
Name: dmorse03
Date: January 29, 2002 at 17:46:56 Pacific
Reply:

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.txt

Bear this in mind when trying to locate files/Directories in DOS.

Don


0

Response Number 5
Name: george
Date: January 29, 2002 at 18:16:18 Pacific
Reply:

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!


0

Related Posts

See More



Response Number 6
Name: DeePoNE
Date: January 30, 2002 at 09:51:13 Pacific
Reply:

go here
http://www3.sympatico.ca/rhwatson/dos7/


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Windows 95/98 Forum Home


Sponsored links

Ads by Google


Results for: How to delete file using DOS prompt

How to delete files in dos? www.computing.net/answers/windows-95/how-to-delete-files-in-dos/114210.html

How to delete these 0 byte files? www.computing.net/answers/windows-95/how-to-delete-these-0-byte-files/144861.html

deleting files from folder www.computing.net/answers/windows-95/deleting-files-from-folder/128191.html