Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Deleting large directories

Reply
Thread Tools Display Modes

Deleting large directories

 
 
John Stubbings
Guest
Posts: n/a

 
      09-11-2007
Vista Business

Keep having problems deleting large directories. Errors relating to sub
directories not empty. I have to keep drilling down directories until I can
delete files. I've reset permissions and taken ownership both using the GUI
and command line till I'm blue in the face nothing helps. Run chkdsk says
all OK.

 
Reply With Quote
 
 
 
 
gs
Guest
Posts: n/a

 
      09-11-2007
have you try the following ( use with Caution: Be careful)?
rd /s theDirYouWantGone

from command line
if you still have trouble there may be files/directory you don't have
access or marked protected somehow

Also remember not all files or folders are actually residing where they
appear

"John Stubbings" <anna.riceDELETE-> wrote in message
news:...
> Vista Business
>
> Keep having problems deleting large directories. Errors relating to sub
> directories not empty. I have to keep drilling down directories until I
> can
> delete files. I've reset permissions and taken ownership both using the
> GUI
> and command line till I'm blue in the face nothing helps. Run chkdsk says
> all OK.



 
Reply With Quote
 
keepout@yahoo.com.invalid
Guest
Posts: n/a

 
      09-11-2007
On Tue, 11 Sep 2007 23:02:10 +0100, "John Stubbings"
<anna.riceDELETE-> wrote:

>Vista Business
>
>Keep having problems deleting large directories. Errors relating to sub
>directories not empty. I have to keep drilling down directories until I can
>delete files. I've reset permissions and taken ownership both using the GUI
>and command line till I'm blue in the face nothing helps. Run chkdsk says
>all OK.


use the DOS interface. CD to the directory above the one you want to delete
ie:

C:\temp\temp2
CD to C:\temp

then use RD /s /q temp2.
GONE.....

or start - start search box - CMD - CD to C:\temp\ or whatever the directory
above the directory you want to remove is located.

then use RD /s /q directory_name_you_want_to_delete.
GONE.....

If it's a big name for the root directory, try and rename it before you go to
dos, and [COPY] the file name into the clipboard instead of renaming.

then use RD /s /q [PASTE from clipboard] "extremely long directory name with
spaces that make the name useless and hard to delete"

don't forget the quote marks around the name.

GONE.....
If you can't do it, turn UAC off and repeat.
--
more pix @ http://members.toast.net/cbminfo/index.html
 
Reply With Quote
 
John Stubbings
Guest
Posts: n/a

 
      09-11-2007
<> wrote in message
news:...
On Tue, 11 Sep 2007 23:02:10 +0100, "John Stubbings"
<anna.riceDELETE-> wrote:

>Vista Business
>
>Keep having problems deleting large directories. Errors relating to sub
>directories not empty. I have to keep drilling down directories until I can
>delete files. I've reset permissions and taken ownership both using the GUI
>and command line till I'm blue in the face nothing helps. Run chkdsk says
>all OK.


use the DOS interface. CD to the directory above the one you want to delete
ie:

C:\temp\temp2
CD to C:\temp

then use RD /s /q temp2.
GONE.....

or start - start search box - CMD - CD to C:\temp\ or whatever the directory
above the directory you want to remove is located.

then use RD /s /q directory_name_you_want_to_delete.
GONE.....

If it's a big name for the root directory, try and rename it before you go
to
dos, and [COPY] the file name into the clipboard instead of renaming.

then use RD /s /q [PASTE from clipboard] "extremely long directory name with
spaces that make the name useless and hard to delete"

don't forget the quote marks around the name.

GONE.....
If you can't do it, turn UAC off and repeat.
--
more pix @ http://members.toast.net/cbminfo/index.html



Done all of that, it's a permissions issue, but taken ownership and full
control etc command line and GUI and rd /s and no joy. It's a pain, errors
like cannot delete directory contains files, or you need permission to
delete this file, and click through UAC fails

 
Reply With Quote
 
keepout@yahoo.com.invalid
Guest
Posts: n/a

 
      09-12-2007
On Wed, 12 Sep 2007 00:59:29 +0100, "John Stubbings"
<anna.riceDELETE-> wrote:

>
>If you can't do it, turn UAC off and repeat.
>--
>more pix @ http://members.toast.net/cbminfo/index.html
>
>
>
>Done all of that, it's a permissions issue, but taken ownership and full
>control etc command line and GUI and rd /s and no joy. It's a pain, errors
>like cannot delete directory contains files, or you need permission to
>delete this file, and click through UAC fails


You turned off UAC, then tried what I told you ?
If you have no use for permissions, you can do like I've done. Takes awhile on
a large drive. Maybe an hour or a bit less.

But I no longer have to tell the machine to do something 2 or 3 times or more.
I hit a button and it almost always does what it's told.

I also trust my virus software to take up where UAC, and all the windows
security fails.

right click C:\
or just the folder you want permission. This assumes you have permission to
change permissions.

PROPERTIES - SECURITY tab - USERS - ADVANCED, [1] - PERMISSIONS - USERS -
USERS - toggle REPLACE all existing & inheritable etc.. from object - EDIT -
toggle FULL CONTROL ON. should toggle all below, users should be selected.
Apply to this folder, sub folders & files. [this one should really take some
time] more than 10,000 files and 700 folders for me.
But it normally only has to be done once.

[1] OWNER tab - edit - select you - toggle 'replace owner on sub containers &
objects' apply [may take some time, get a drink or lunch.]

You're positive you have UAC off ?
--
more pix @ http://members.toast.net/cbminfo/index.html
 
Reply With Quote
 
Andrew McLaren
Guest
Posts: n/a

 
      09-12-2007
"John Stubbings" <anna.riceDELETE-> wrote...
> Keep having problems deleting large directories. Errors relating to sub
> directories not empty. I have to keep drilling down directories until I
> can
> delete files. I've reset permissions and taken ownership both using the
> GUI
> and command line till I'm blue in the face nothing helps. Run chkdsk says
> all OK.


I guess you're using "rd /s" after using takeown and icacls commands, to
take ownership and grant yourself permissions recursively to all
subdirectories and files in the tree?:


C:\>takeown /F C:\MyDirectory /R /D y

C:\>icalcs C:\MyDirectory /grant:r John:F

I'll assume you've done this and you're still seeing problems.

Normal Win32 commands cannot delete a file or directory whose pathname is
more than 260 characters long. If your large directory has many long
pathnames, that may be the problem (see for example,
http://support.microsoft.com/kb/320081). The best workaround I have found
for this is to use the "rmdir" command in the Services for Unix subsystem.
POSIX commands are not subject to the Win32 MAX_PATH limitation. But not
everyone has the Unix subsystem installed (if not, why not? :-). The next
alternative is to shorten the path names, begining from the top, so that the
path gets to less than 260 chars. So, if you have a path like this:

C:\Directory1\Subdirectory2\subdirectory3\subdirec tory4\subdirectory5\...
etc

start by renaing "Directory1" to a single character, such as "1". Then try
"rd /s c:\1" again. If it still complains, renames Subsdirectory2 to a
single char, such as "2". And so on. Eventually, the longest path in the
tree will get back down under 260 chars in length, and the whole tree can be
deleted.

This will only work if the obstacle is the length of the pathnames. If you
are being prevented from deleteing files because they are in use, or you do
not have permissions etc, you will need to use other steps to correct the
problem.

--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
John Stubbings
Guest
Posts: n/a

 
      09-12-2007
"Andrew McLaren" <> wrote in message
news:673DA095-C6A7-4937-9C0A-...
> "John Stubbings" <anna.riceDELETE-> wrote...
>> Keep having problems deleting large directories. Errors relating to sub
>> directories not empty. I have to keep drilling down directories until I
>> can
>> delete files. I've reset permissions and taken ownership both using the
>> GUI
>> and command line till I'm blue in the face nothing helps. Run chkdsk says
>> all OK.

>
> I guess you're using "rd /s" after using takeown and icacls commands, to
> take ownership and grant yourself permissions recursively to all
> subdirectories and files in the tree?:
>
>
> C:\>takeown /F C:\MyDirectory /R /D y
>
> C:\>icalcs C:\MyDirectory /grant:r John:F
>
> I'll assume you've done this and you're still seeing problems.
>
> Normal Win32 commands cannot delete a file or directory whose pathname is
> more than 260 characters long. If your large directory has many long
> pathnames, that may be the problem (see for example,
> http://support.microsoft.com/kb/320081). The best workaround I have found
> for this is to use the "rmdir" command in the Services for Unix subsystem.
> POSIX commands are not subject to the Win32 MAX_PATH limitation. But not
> everyone has the Unix subsystem installed (if not, why not? :-). The next
> alternative is to shorten the path names, begining from the top, so that
> the path gets to less than 260 chars. So, if you have a path like this:
>
>
> C:\Directory1\Subdirectory2\subdirectory3\subdirec tory4\subdirectory5\...
> etc
>
> start by renaing "Directory1" to a single character, such as "1". Then try
> "rd /s c:\1" again. If it still complains, renames Subsdirectory2 to a
> single char, such as "2". And so on. Eventually, the longest path in the
> tree will get back down under 260 chars in length, and the whole tree can
> be deleted.
>
> This will only work if the obstacle is the length of the pathnames. If you
> are being prevented from deleteing files because they are in use, or you
> do not have permissions etc, you will need to use other steps to correct
> the problem.
>
> --
> Andrew McLaren
> amclar (at) optusnet dot com dot au
>



Thanks, yes used rd takeown and icalcs as you say. Thought about directory
length, but I can copy directory to my Desktop and delete that, this has
slightly longer path, and I can go into subdirectories and delete from
there.

I don't think Services for Unix subsystem is available for Vista Business
just Ultimate, unless you know different? Good idea though. To be honest
this should just work, I don't have any problems on XP, Windows 98, Linux,
Windows server 2003....

This all seems to have started when I copied some files from a Windows 98
and a Linux computer over the network. The fix seems to be to copy the
directory and spend an hour or two deleteing the old directory bit by bit.
Pain, I had to do this several times so far when restructuring my data.









 
Reply With Quote
 
Andrew McLaren
Guest
Posts: n/a

 
      09-12-2007
> This all seems to have started when I copied some files from a Windows 98
> and a Linux computer over the network. The fix seems to be to copy the
> directory and spend an hour or two deleteing the old directory bit by bit.
> Pain, I had to do this several times so far when restructuring my data.


What is the exact text of the error message you get, if you do a "rd /s" on
the tree?

--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
Dave Cox
Guest
Posts: n/a

 
      09-12-2007
"John Stubbings" <anna.riceDELETE-> wrote in
news::

> "Andrew McLaren" <> wrote in message
> news:673DA095-C6A7-4937-9C0A-...
>> "John Stubbings" <anna.riceDELETE-> wrote...
>>> Keep having problems deleting large directories. Errors relating
>>> to sub directories not empty. I have to keep drilling down
>>> directories until I can
>>> delete files. I've reset permissions and taken ownership both
>>> using the GUI
>>> and command line till I'm blue in the face nothing helps. Run
>>> chkdsk says all OK.

>>
>> I guess you're using "rd /s" after using takeown and icacls
>> commands, to take ownership and grant yourself permissions
>> recursively to all subdirectories and files in the tree?:
>>
>>
>> C:\>takeown /F C:\MyDirectory /R /D y
>>
>> C:\>icalcs C:\MyDirectory /grant:r John:F
>>
>> I'll assume you've done this and you're still seeing problems.
>>
>> Normal Win32 commands cannot delete a file or directory whose
>> pathname is more than 260 characters long. If your large
>> directory has many long pathnames, that may be the problem (see
>> for example, http://support.microsoft.com/kb/320081). The best
>> workaround I have found for this is to use the "rmdir" command in
>> the Services for Unix subsystem. POSIX commands are not subject
>> to the Win32 MAX_PATH limitation. But not everyone has the Unix
>> subsystem installed (if not, why not? :-). The next alternative
>> is to shorten the path names, begining from the top, so that the
>> path gets to less than 260 chars. So, if you have a path like
>> this:
>>
>>
>> C:\Directory1\Subdirectory2\subdirectory3\subdirec tory4\subdirecto
>> ry5\... etc
>>
>> start by renaing "Directory1" to a single character, such as "1".
>> Then try "rd /s c:\1" again. If it still complains, renames
>> Subsdirectory2 to a single char, such as "2". And so on.
>> Eventually, the longest path in the tree will get back down under
>> 260 chars in length, and the whole tree can be deleted.
>>
>> This will only work if the obstacle is the length of the
>> pathnames. If you are being prevented from deleteing files
>> because they are in use, or you do not have permissions etc, you
>> will need to use other steps to correct the problem.
>>
>> --
>> Andrew McLaren
>> amclar (at) optusnet dot com dot au
>>

>
>
> Thanks, yes used rd takeown and icalcs as you say. Thought about
> directory length, but I can copy directory to my Desktop and
> delete that, this has slightly longer path, and I can go into
> subdirectories and delete from there.
>
> I don't think Services for Unix subsystem is available for Vista
> Business just Ultimate, unless you know different? Good idea
> though. To be honest this should just work, I don't have any
> problems on XP, Windows 98, Linux, Windows server 2003....
>
> This all seems to have started when I copied some files from a
> Windows 98 and a Linux computer over the network. The fix seems to
> be to copy the directory and spend an hour or two deleteing the
> old directory bit by bit. Pain, I had to do this several times so
> far when restructuring my data.
>
>
>
>
>
>
>
>
>



Did you copy the directories to your C:\Users\(your user name)\
folder?


If you work with files or directories under your user account and
folder you shouldn't have any issues working with files or
directories.

--
The most reliable time to upgrade to a new Operating System is at the
end of its life cycle.

Dave
 
Reply With Quote
 
keepout@yahoo.com.invalid
Guest
Posts: n/a

 
      09-12-2007
On Wed, 12 Sep 2007 10:34:22 +0100, "John Stubbings"
<anna.riceDELETE-> wrote:

>This all seems to have started when I copied some files from a Windows 98
>and a Linux computer over the network. The fix seems to be to copy the
>directory and spend an hour or two deleteing the old directory bit by bit.
>Pain, I had to do this several times so far when restructuring my data.


I'm just guessing, but I installed a HD from my XP machine with all files
intact.
There was now a New numeric [12-0-3-67-hy-56] etc... user in the owners..The
fix was to delete that numeric user and take the permissions the way I showed
you.
--
more pix @ http://members.toast.net/cbminfo/index.html
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting large .avi files and .vob files Klassickoi Windows Vista Performance 2 02-09-2008 04:02 PM
FTP whole directories? Mike C Windows Vista General Discussion 4 01-11-2008 02:37 PM
deleting large file (video) while alreading being sent. Windows Vi DM Windows Vista Mail 3 12-29-2007 11:46 AM
merge directories marty Windows Vista General Discussion 2 10-06-2007 04:28 PM
Problems with Directories Idiot_Ronin Windows Vista General Discussion 0 08-17-2007 12:53 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59