PC Review


Reply
Thread Tools Rate Thread

deleting files but leaving folders intact

 
 
=?Utf-8?B?amFtZXMuam9obnNvbg==?=
Guest
Posts: n/a
 
      24th Jan 2005
Greetings

I would like to know how to delete files & folders inside a specific folder
without having to manualy go into each folder and delete it myself, reason
being is there are over 1600 of them....

The existing structure is like this

studentsprofiles$\year\%username%\ <-anything below this needs to be deleted.

The folder %username% is a default users profile folder, i need to delete
whats in this folder but to keep the main profile folder with its permissions.

Please could anyone let me know how this can be done via script(which i dont
know how to do) or batchfile..

Many thanks.
 
Reply With Quote
 
 
 
 
Jerold Schulman
Guest
Posts: n/a
 
      24th Jan 2005
On Mon, 24 Jan 2005 08:19:06 -0800, "james.johnson" <(E-Mail Removed) k> wrote:

>Greetings
>
>I would like to know how to delete files & folders inside a specific folder
>without having to manualy go into each folder and delete it myself, reason
>being is there are over 1600 of them....
>
>The existing structure is like this
>
>studentsprofiles$\year\%username%\ <-anything below this needs to be deleted.
>
>The folder %username% is a default users profile folder, i need to delete
>whats in this folder but to keep the main profile folder with its permissions.
>
>Please could anyone let me know how this can be done via script(which i dont
>know how to do) or batchfile..
>
>Many thanks.



See Deltree at tip 617 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Reply With Quote
 
R. C. White
Guest
Posts: n/a
 
      24th Jan 2005
Hi, James.

I'm not sure I understand your whole problem, but in your batch file (run
from the "DOS" window or a Command Prompt, I assume), you can use the rd (or
rmdir) command with the /s parameter. As with any command in the "DOS"
window, type the command followed by /? to see a mini-Help file showing all
the switches and parameters available with that command.

Rd /? shows only /s and /q. The /s switch removes the named folder,
including all the files and subfolders within it, after asking "Are you
sure?" The /q skips the question and removes it all immediately.

I don't really recall how to do this for many different <foldernames> in
succession, because I haven't written any serious batch file in years. You
would use a for...next loop, feeding it a folder name at a time from a list
in a text file, I suppose, but I'll leave this step for someone else. ;^}

Hmm... I reread your question. It asks about profiles and permissions,
which I know nothing about. (As just one guy with one computer and no user
but me, I haven't had to learn about those.)

RC
--
R. C. White, CPA
San Marcos, TX
(E-Mail Removed)
Microsoft Windows MVP

"james.johnson" <(E-Mail Removed) k> wrote in message
news:5F917012-635F-4841-9AE8-(E-Mail Removed)...
> Greetings
>
> I would like to know how to delete files & folders inside a specific
> folder
> without having to manualy go into each folder and delete it myself, reason
> being is there are over 1600 of them....
>
> The existing structure is like this
>
> studentsprofiles$\year\%username%\ <-anything below this needs to be
> deleted.
>
> The folder %username% is a default users profile folder, i need to delete
> whats in this folder but to keep the main profile folder with its
> permissions.
>
> Please could anyone let me know how this can be done via script(which i
> dont
> know how to do) or batchfile..
>
> Many thanks.


 
Reply With Quote
 
=?Utf-8?B?amFtZXMuam9obnNvbg==?=
Guest
Posts: n/a
 
      25th Jan 2005
Thanks for all your help guys. I know batch files reasonably well. I will
give it a try.

regards
James
 
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
Keep the Favorite Folders intact in my Outlook! =?Utf-8?B?c3dlY21o?= Microsoft Outlook Discussion 1 31st May 2006 12:28 PM
delete text boxes from word document leaving text intact =?Utf-8?B?d29vZHk=?= Microsoft Word Document Management 2 17th Apr 2006 03:30 PM
Keep formual intact after deleting a line =?Utf-8?B?dmFjYXRpb24=?= Microsoft Excel Worksheet Functions 1 3rd Mar 2006 08:12 PM
How to create a TEST site - leaving original site intact =?Utf-8?B?QmFycnk=?= Microsoft Frontpage 6 18th Dec 2005 03:41 PM
Opening a sub page leaving the original intact. =?Utf-8?B?TWlrZTE3MTEy?= Microsoft Frontpage 3 11th Apr 2005 07:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 PM.