PC Review


Reply
Thread Tools Rate Thread

Deleting folders within a folder but keeping the parent folder

 
 
Paul McGeoghan
Guest
Posts: n/a
 
      23rd Oct 2009
Hi,
In Windows XP SP3, how do I remove folders within a folder:

Specifically:
D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
SQL Server Data\QSRNVIVO8

I want to keep the parent folder:
D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
SQL Server Data

Del *.* only deletes files within a folder.

Thanks,
Paul

 
Reply With Quote
 
 
 
 
boatman312
Guest
Posts: n/a
 
      23rd Oct 2009
Paul McGeoghan wrote:
> Hi,
> In Windows XP SP3, how do I remove folders within a folder:
>
> Specifically:
> D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> SQL Server Data\QSRNVIVO8
>
> I want to keep the parent folder:
> D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> SQL Server Data
>
> Del *.* only deletes files within a folder.
>
> Thanks,
> Paul
>

Consider using xdel (Available from Sourceforge) or xxcopy (xxcopy.com).
Both have extra options to do what you want. Xxcopy is much more
powerful, but also more complicated.
 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a
 
      23rd Oct 2009

"Paul McGeoghan" <(E-Mail Removed)> wrote in message
news:47D45B4F-1894-48C5-B6C2-(E-Mail Removed)...
> Hi,
> In Windows XP SP3, how do I remove folders within a folder:
>
> Specifically:
> D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> SQL Server Data\QSRNVIVO8
>
> I want to keep the parent folder:
> D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> SQL Server Data
>
> Del *.* only deletes files within a folder.
>
> Thanks,
> Paul


Here are a few methods:

a) The easy way:
rd /s /q "D:\UserData\%username%\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\QSRNVIVO8"
md "D:\UserData\%username%\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\QSRNVIVO8"

b) The laborious way:
@echo off
del /q "D:\UserData\%username%\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\QSRNVIVO8\*.*"
for /D %%a in ("D:\UserData\%username%\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\QSRNVIVO8\*.*") do rd /s /q "%%a"

c) The sneaky way:
pushd "D:\UserData\%username%\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\QSRNVIVO8"
rd /s /q "D:\UserData\%username%\Local Settings\Application
Data\Microsoft\Microsoft SQL Server Data\QSRNVIVO8"
popd


 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      23rd Oct 2009
On Fri, 23 Oct 2009 03:36:01 -0700, Paul McGeoghan
<(E-Mail Removed)> wrote:

>Hi,
>In Windows XP SP3, how do I remove folders within a folder:
>
>Specifically:
>D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
>SQL Server Data\QSRNVIVO8
>
>I want to keep the parent folder:
>D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
>SQL Server Data
>
>Del *.* only deletes files within a folder.
>
>Thanks,
>Paul


Delete from the menu bar ?
 
Reply With Quote
 
Anthony Buckland
Guest
Posts: n/a
 
      23rd Oct 2009

"Paul McGeoghan" <(E-Mail Removed)> wrote in message
news:47D45B4F-1894-48C5-B6C2-(E-Mail Removed)...
> Hi,
> In Windows XP SP3, how do I remove folders within a folder:
>
> Specifically:
> D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> SQL Server Data\QSRNVIVO8
>
> I want to keep the parent folder:
> D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> SQL Server Data
>
> Del *.* only deletes files within a folder.
>
> Thanks,
> Paul
>


Is something preventing you from just opening My Computer,
navigating to the folders in question, highlighting them, and
pressing the Delete key?


 
Reply With Quote
 
Paul McGeoghan
Guest
Posts: n/a
 
      28th Oct 2009

I need to automate it via a script or something as this needs to be done for
all users (not just me), some of which do not have admin privileges to do it.

Will try one of the solutions by the first 2 posters, thanks.

"Anthony Buckland" wrote:

>
> "Paul McGeoghan" <(E-Mail Removed)> wrote in message
> news:47D45B4F-1894-48C5-B6C2-(E-Mail Removed)...
> > Hi,
> > In Windows XP SP3, how do I remove folders within a folder:
> >
> > Specifically:
> > D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> > SQL Server Data\QSRNVIVO8
> >
> > I want to keep the parent folder:
> > D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
> > SQL Server Data
> >
> > Del *.* only deletes files within a folder.
> >
> > Thanks,
> > Paul
> >

>
> Is something preventing you from just opening My Computer,
> navigating to the folders in question, highlighting them, and
> pressing the Delete key?
>
>
> .
>

 
Reply With Quote
 
Bob I
Guest
Posts: n/a
 
      28th Oct 2009
Are there files in the parent folder that preclude deleting the folder
and then creating it again?

Paul McGeoghan wrote:

> I need to automate it via a script or something as this needs to be done for
> all users (not just me), some of which do not have admin privileges to do it.
>
> Will try one of the solutions by the first 2 posters, thanks.
>
> "Anthony Buckland" wrote:
>
>
>>"Paul McGeoghan" <(E-Mail Removed)> wrote in message
>>news:47D45B4F-1894-48C5-B6C2-(E-Mail Removed)...
>>
>>>Hi,
>>>In Windows XP SP3, how do I remove folders within a folder:
>>>
>>>Specifically:
>>>D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
>>>SQL Server Data\QSRNVIVO8
>>>
>>>I want to keep the parent folder:
>>>D:\UserData\%username%\Local Settings\Application Data\Microsoft\Microsoft
>>>SQL Server Data
>>>
>>>Del *.* only deletes files within a folder.
>>>
>>>Thanks,
>>>Paul
>>>

>>
>>Is something preventing you from just opening My Computer,
>>navigating to the folders in question, highlighting them, and
>>pressing the Delete key?
>>
>>
>>.
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
maximum number of folders in one parent folder Paul Windows XP Configuration 12 3rd Sep 2009 04:24 PM
maximum number of folders in one parent folder Paul Windows XP Basics 9 3rd Sep 2009 03:38 AM
maximum number of folders in one parent folder Paul Windows XP Help 9 3rd Sep 2009 03:38 AM
Deleting Parent folder and keeping the subfolders Ravi Verma Windows XP Basics 10 20th Apr 2006 09:50 PM
See same sub-folder in two parent folders =?Utf-8?B?QmFycnlEYXZpZXM=?= Microsoft Windows 2000 7 26th Nov 2004 06:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:09 AM.