Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

Why am I unable to delete certain files

I have backed up files under my users directory to an external hard drive.  I want to delete these files on the external hard drives but I am getting a message that states that some file names are too big and I am not allowed to delete the files or the directory they are in.  I don't understand why not.  

How can I delete the folders and all of these files from my external hard drive short of doing a reformat?
0
WoodrowA
Asked:
WoodrowA
  • 4
  • 3
  • 2
  • +2
10 Solutions
 
helpfinderCommented:
if you can move these files/folders from external drive to computer you  can try a trick - create new user account, move it to dekttop of this profile and then delete profile

problem could be related to max 255 characters in NTFS file system - you can try to delete it in linux, boot some Live CD and check that way
0
 
Steven HarrisPresidentCommented:
Navigate to Computer and right-click on the external drive.  Go to Properties > Security > Advanced and check the owner of the files.  If it set to SYSTEM, or something similar, change the Owner to your local account (COMPUTERNAME\username) and check "Replace owner on subcontainers and objects".

This will force your user account to take full control of the drive and the objects contained on it.

Now try deleting the files/folders.
0
 
nobusCommented:
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Detlef001Commented:
Some more searching and I have the solution. Change the owner recipe:

Right-click on folder -> Properties
Security Tab
Click on Advanced button
Owner tab
Edit.. button
select Administrators in 'Change owner to', check 'replace owner on subcontainers and objects'..this might take a while
Open cmd.exe as administrator
type 'cacls l:\messedUpFolder /T /e /g Administrators:f' ...this might take a while
rmdir /S l:\messedUpFolder
0
 
WoodrowAAuthor Commented:
@Nobus
Thank you for responding.

I went to the to the download site but saw many messages about an additional toolbar that gets installed (whether you want it or not).  I fouond a competitive product called Lockhunter 3.1.1.  See
http://www.techspot.com/downloads/4860-lockhunter.html

However, neither of these tools talk about this specific problem (file names being too long).
0
 
nobusCommented:
then open a cmd prompt as admin
use the command del c:\users\MyName\"my documents\picturesor whatever\file"

in other words- put the long name between double quotes
0
 
WoodrowAAuthor Commented:
@nobus
Thank you for responding.
I appreciate your input but please bear in mind that what I want to do is not just delete a file.  I want to be able to delete folders that contain other folders wherein the path statment is very long. Example:

P:\Data_Backups\Users\Woody_2\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\7U80504H

What I really want to delete is the folder P:\Data_Backups  and all sub folders.  The syntax with quotation marks does not seem to work on folders.  I downloaded Lockhunter and tried it and it too is unable to delete these folders.  Very Frustrating.
0
 
Steven HarrisPresidentCommented:
@WoodrowA,

Have you tried taking permissions of the file as suggested in post a39707471?
0
 
WoodrowAAuthor Commented:
@ThinkSpace
Yes, I did try your suggestion and I thought I had responded to it here but there must have been some sort of malfunction because I don't see the response now.  As I remember it, I was already listed as the owner.  My screens didn't seem to match your instructions exactly so I  asked for further clarification.  

However, I have solved the problem.  It was tedious but at least the folders are deleted.  I did it by going to each of the folders that contained long file names and mapping that folder to a drive letter.  Once this was done I was able to delete the folder from the mapped drive.

I appreciate all the input here.  It is surprising to me that this problem exists, but the real question now is how to avoid this in the future.  Obviously I don't want to simply copy my Users directory.  I'll have to think this through.

Thank you to all again.
0
 
nobusCommented:
try thisd batch file :  
DEL /F /Q /S C:\Directory\*
 for /D %%i in ("C:\Directory\*") do RD /S /Q "%%i"

more info : http://www.techrepublic.com/forums/questions/dos-how-to-delete-all-files-and-subdirectories-in-a-directory/
0
 
WoodrowAAuthor Commented:
Thank you
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now