Solved

Unable to delete a file in Dos

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Installer v3.1 issue on Windows 2000 Advanced Server (Exchange) 3 409
website 1 304
Domain dunctional level. 4 313
Locking down a taskpad 1 151
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…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 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

16 Experts available now in Live!

Get 1:1 Help Now