Solved

Unable to delete a file in Dos

Posted on 2004-09-15
3
132 Views
Last Modified: 2010-04-14

I am unable to delete a load of files in DOS but I can when i'm in windows. Just keeps saying accessed denied.
0
Comment
Question by:gabbs1
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 125 total points
ID: 12063175

>>
Open a Command Prompt window and leave it open. Close all open programs. Click Start, Run and enter TASKMGR.EXE Go to the Processes tab and End Process on Explorer.exe. Leave Task Manager open. Go back to the Command Prompt window and change to the directory the undeletable file is located in. At the command prompt type DEL where is the file you wish to delete. Go back to Task Manager, click File, New Task and enter EXPLORER.EXE to restart the GUI shell. Close Task Manager.

Can't delete file or folder:
  http://support.microsoft.com/?kbid=320081
  http://www.theeldergeek.com/delete_undeletable_file.htm 


To take ownership of a folder:
   Right-click the folder you want to take ownership of, and then click Properties.
   Click the Security tab, and then click OK on the Security message (if one appears).
   Click Advanced, and then click the Owner tab.
   In the Name list, click your user name, Administrator if you are logged in as Administrator, or click the
   Administrators group. If you want to take ownership of the contents of that folder, click to select the Replace
   owner on subcontainers and objects check box.
   Click OK. The following message appears, where folder name is the name of the folder that you want to take ownership of:
   You do not have permission to read the contents of directory folder name. Do you want to replace the directory permissions
   with permissions granting you Full Control?

   All permissions will be replaced if you press Yes.

   Click Yes.
   Click OK, and then reapply the permissions and security settings that you want for the folder and its contents.
   
How to Take Ownership of a File
  NOTE: You must be logged on to the computer using an account that has administrative privileges.

  To take ownership of a file, follow these steps:
  Right-click the file you want to take ownership of, and then click Properties.
  Click the Security tab, and then click OK on the Security message (if one appears).
  Click Advanced, and then click the Owner tab.
  In the Name list click Administrator, or click the Administrators group, and then click OK.

  The Administrator or Administrators group now owns the file. To change the permissions on the files and folders under
  this folder, continue to step 5.
  Click Add.
  In the Enter the object names to select (examples) list, type the user or group account to which you want to give access
  to the file. For example, Administrator.
  Click OK.
  In the Group or user names list, click the account that you want (for example, Administrator), and then click to select
  the check boxes of the permissions that you want to assign that user. For example, Full Control [Allow]. When you are
  finished assigning permissions, click OK.

ref: http://support.microsoft.com/?kbid=308421
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12063182
Check if the fiels are marked as read only. You cannot delete directly such  files from DOS
0
 
LVL 1

Expert Comment

by:NickRyan
ID: 12082603
It may be a simpler problem that sirbounty's solution...

Open up the command prompt, go to the directory where you want to delete the files and try typing

attrib <filespec>

where <filespec> is the file spec of the files that you were trying to delete (ie, "*.jpg").

This will list the file attributes of the offending files. If the files were copied from a CD then MS (for some silly reason that's nobody has managed to explain) decided that they should all copied over as read-only onto your hard disk.

If the files are listed as read only, type the following into the command prompt:

attrib -r <filsepec>

You should then be able to delete the files in DOS.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question