Solved

Why am I unable to delete certain files

Posted on 2013-12-09
11
393 Views
Last Modified: 2013-12-24
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
Comment
Question by:WoodrowA
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 19

Accepted Solution

by:
helpfinder earned 72 total points
Comment Utility
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
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 143 total points
Comment Utility
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
 
LVL 91

Assisted Solution

by:nobus
nobus earned 214 total points
Comment Utility
0
 
LVL 3

Assisted Solution

by:Detlef001
Detlef001 earned 71 total points
Comment Utility
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
 

Assisted Solution

by:WoodrowA
WoodrowA earned 0 total points
Comment Utility
@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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 91

Assisted Solution

by:nobus
nobus earned 214 total points
Comment Utility
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
 

Assisted Solution

by:WoodrowA
WoodrowA earned 0 total points
Comment Utility
@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
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 143 total points
Comment Utility
@WoodrowA,

Have you tried taking permissions of the file as suggested in post a39707471?
0
 

Assisted Solution

by:WoodrowA
WoodrowA earned 0 total points
Comment Utility
@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
 
LVL 91

Assisted Solution

by:nobus
nobus earned 214 total points
Comment Utility
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
 

Author Closing Comment

by:WoodrowA
Comment Utility
Thank you
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you use NetMotion Mobility on your PC and plan to upgrade to Windows 10, it may not work unless you take these steps.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
The goal of this Micro Tutorial is to help navigate beginning users with the app store on Windows 8. It will explain exciting features how to maximize your PC through these apps. This will be demonstrated using Windows 8 operating system.

744 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

18 Experts available now in Live!

Get 1:1 Help Now