Solved

Why am I unable to delete certain files

Posted on 2013-12-09
11
397 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
ID: 39707404
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
ID: 39707471
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
ID: 39708396
0
 
LVL 3

Assisted Solution

by:Detlef001
Detlef001 earned 71 total points
ID: 39708715
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
ID: 39708957
@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
[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

 
LVL 91

Assisted Solution

by:nobus
nobus earned 214 total points
ID: 39709150
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
ID: 39709441
@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
ID: 39709482
@WoodrowA,

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

Assisted Solution

by:WoodrowA
WoodrowA earned 0 total points
ID: 39709541
@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
ID: 39710646
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
ID: 39737640
Thank you
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

863 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

19 Experts available now in Live!

Get 1:1 Help Now