Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

How to delete deep directory hierarchy

microsoft.public.windows.vista.general






Speedup My PC
Reply
  #1 (permalink)  
Old 03-09-2010
Mário
 

Posts: n/a
How to delete deep directory hierarchy
Hello,

I have a deep directory hierarchy (which was created programmatically)
having a too long path name such that I cannot delete it from explorer
or via DOS.
I tried,

rmdir /S /Q dir

but it does not work.

Does someone know how to delete a directory structure with too much
deep descendent entries?

Best Regards,
Mario
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-10-2010
M Skabialka
 

Posts: n/a
Re: How to delete deep directory hierarchy
Can you drag and drop one of the nested folders to a root folder, which will
give it a shorter path, then delete it there?
Mich

"Mário" <mario.luis.guimaraes@gmail.com> wrote in message
news:0be9a762-8eef-4500-ac13-cf177f49259f@g7g2000yqe.googlegroups.com...
> Hello,
>
> I have a deep directory hierarchy (which was created programmatically)
> having a too long path name such that I cannot delete it from explorer
> or via DOS.
> I tried,
>
> rmdir /S /Q dir
>
> but it does not work.
>
> Does someone know how to delete a directory structure with too much
> deep descendent entries?
>
> Best Regards,
> Mario



Reply With Quote
  #3 (permalink)  
Old 03-11-2010
Gene E. Bloch
 

Posts: n/a
Re: How to delete deep directory hierarchy
On Tue, 9 Mar 2010 11:57:48 -0800 (PST), Mário wrote:

> Hello,
>
> I have a deep directory hierarchy (which was created programmatically)
> having a too long path name such that I cannot delete it from explorer
> or via DOS.
> I tried,
>
> rmdir /S /Q dir
>
> but it does not work.
>
> Does someone know how to delete a directory structure with too much
> deep descendent entries?
>
> Best Regards,
> Mario


This thread suggests renaming as m any files as possible to on-letter
names:
http://forum.notebookreview.com/showthread.php?t=129256

This thread:
http://www.pcreview.co.uk/forums/thread-283739.php
suggests this: http://www.abtollc.com/products.aspx

If you don't like those, do what I did - Google for
delete long path name files

--
Gene E. Bloch letters0x40blochg0x2Ecom
Reply With Quote
  #4 (permalink)  
Old 03-11-2010
John John - MVP
 

Posts: n/a
Re: How to delete deep directory hierarchy
Mário wrote:
> Hello,
>
> I have a deep directory hierarchy (which was created programmatically)
> having a too long path name such that I cannot delete it from explorer
> or via DOS.
> I tried,
>
> rmdir /S /Q dir
>
> but it does not work.
>
> Does someone know how to delete a directory structure with too much
> deep descendent entries?


Map (over a network) or substitute (locally) the long directory path to
a drive and then delete the files from the mapped or substituted drive.
Locally, at a command prompt:

subst x: c:\long path

now you can delete file from the X drive, when done delete the
substituted drive:

subst x: /d

(Map over a network with the net use command)

Tip: You can grab folders from Windows Explorer and then drag and drop
them to the command prompt, or you can Copy & Paste to the Command line.
To substitute the current directory you can use a period:

subst x: .

will substitute the current directory to drive X.

John
Reply With Quote
  #5 (permalink)  
Old 03-11-2010
 

Posts: n/a
Re: How to delete deep directory hierarchy
rmdir /S /Q \\.\c:\dir\dir\dir

note the \\.\ prepended to the path

--
..
--
"Mário" <mario.luis.guimaraes@gmail.com> wrote in message
news:0be9a762-8eef-4500-ac13-cf177f49259f@g7g2000yqe.googlegroups.com...
> Hello,
>
> I have a deep directory hierarchy (which was created programmatically)
> having a too long path name such that I cannot delete it from explorer
> or via DOS.
> I tried,
>
> rmdir /S /Q dir
>
> but it does not work.
>
> Does someone know how to delete a directory structure with too much
> deep descendent entries?
>
> Best Regards,
> Mario


Reply With Quote
  #6 (permalink)  
Old 03-11-2010
Mário
 

Posts: n/a
Re: How to delete deep directory hierarchy
Hello,

I finally managed to solve the problem.

Suppose that the very long path is "d:\a\mydir\mydir\mydir\...", then
the simplest solution I found was

1) Create a .bat file with this code:

@echo off
mkdir d:\b
:start
move d:\a\mydir\mydir\mydir\mydir\mydir\mydir\mydir\myd ir\mydir\mydir
\mydir\mydir\mydir\mydir\mydir\mydir\mydir\mydir\m ydir\mydir d:\b
rmdir /S /Q d:\a\mydir
move d:\b\mydir\mydir\mydir\mydir\mydir\mydir\mydir\myd ir\mydir\mydir
\mydir\mydir\mydir\mydir\mydir\mydir\mydir\mydir\m ydir\mydir d:\a
rmdir /S /Q d:\b\mydir
goto start


2) Run it.
It will finish with an error for one of the moves reporting that
either "d:\a\mydir\..." or "d:\b\mydir\..." does not exist

3) Finally, do the following

rmdir /S /Q d:\a
rmdir /S /Q d:\b

DONE!

Thanks for your posts.

Best Regards
Mário
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

vB 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
cannot delete directory hawkmaster Windows Vista Ultimate 1 10-25-2008 20:28
Help won't let me delete a directory Jackie Lamorie microsoft.public.windows.vista.performance maintenance 7 05-05-2008 08:46
What to delete in Windows Mail directory Mel microsoft.public.windows.vista.general 3 03-30-2008 04:49
Delete Vista.old Directory Linda microsoft.public.windows.vista.administration accounts passwords 4 07-31-2007 04:34
Trying to delete old windows directory Rob microsoft.public.windows.vista.general 5 02-21-2007 18:04




All times are GMT +1. The time now is 22:03.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120