Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Recursive File Delete
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Buck Turgidson  
View profile  
 More options Nov 6 2009, 7:43 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Buck Turgidson" <jc...@hotmail.com>
Date: Fri, 6 Nov 2009 14:43:56 -0500
Local: Fri, Nov 6 2009 7:43 pm
Subject: Recursive File Delete
I need to delete files from a subdirectory under a bunch of profiles.  In
other words, I have users john, jim, and jill as

c:\documents and settings\john
c:\documents and settings\jim
c:\documents and settings\jill

And each of their profiles has a subdirectory called apps.  In each apps
file for them, I need to delete all .txt files, but only from the apps
subdirectory of their profile.

c:\documents and settings\john\apps
c:\documents and settings\jim\apps
c:\documents and settings\jill\apps

Can anyone help me?


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 6 2009, 7:54 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Fri, 6 Nov 2009 20:54:31 +0100
Local: Fri, Nov 6 2009 7:54 pm
Subject: Re: Recursive File Delete

"Buck Turgidson" <jc...@hotmail.com> wrote in message

news:hd1ua1$eeb$1@news.eternal-september.org...

By far the simplest method is based on a batch file like so:
@echo off
for %%a in (John Jim Jill) do del /s "c:\Documents and
Settings\%%a\apps\*.txt"

Since the command consists of a single line, you could even type it at the
Command Prompt like so:
for %a in (John Jim Jill) do del /s "c:\Documents and
Settings\%a\apps\*.txt"
Note the double versus single % characters.

Or maybe this:
del /s "c:\Documents and Settings\John\apps\*.txt"
del /s "c:\Documents and Settings\Jill\apps\*.txt"
del /s "c:\Documents and Settings\Jim\apps\*.txt"


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Buck Turgidson  
View profile  
 More options Nov 6 2009, 8:04 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Buck Turgidson" <jc...@hotmail.com>
Date: Fri, 6 Nov 2009 15:04:35 -0500
Local: Fri, Nov 6 2009 8:04 pm
Subject: Re: Recursive File Delete
Thanks for the help.  The problem is that the actual number of profiles is
both variable and quite large.  I guess that is the toughest nut to crack.

"Pegasus [MVP]" <n...@microsoft.com> wrote in message

news:OFeA2rxXKHA.1232@TK2MSFTNGP05.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Buck Turgidson  
View profile  
 More options Nov 6 2009, 8:15 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Buck Turgidson" <jc...@hotmail.com>
Date: Fri, 6 Nov 2009 15:15:38 -0500
Local: Fri, Nov 6 2009 8:15 pm
Subject: Re: Recursive File Delete
Thanks.

for /d %a in (*)

seems to do it, if not a bit crudely.

"Pegasus [MVP]" <n...@microsoft.com> wrote in message

news:OFeA2rxXKHA.1232@TK2MSFTNGP05.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 6 2009, 8:42 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Fri, 6 Nov 2009 21:42:08 +0100
Local: Fri, Nov 6 2009 8:42 pm
Subject: Re: Recursive File Delete

"Buck Turgidson" <jc...@hotmail.com> wrote in message

news:hd205c$vcl$1@news.eternal-september.org...

> Thanks.

> for /d %a in (*)

> seems to do it, if not a bit crudely.

Indeed it does - congratulations for working it out for yourself!  For your
next post I recommend that you state *all* requirements right in the
beginning.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google