Solved

Unable to delete a file in Dos

Posted on 2004-09-15
3
130 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

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…
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now