Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unable to delete a file in Dos

Posted on 2004-09-15
3
Medium Priority
?
140 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
With the evolution of technology, we have finally reached a point where it is possible to have home automation features like having your thermostat turn up and door lock itself when you leave, as well as a complete home security system. This is a st…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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