[windows2000] Removing contents of a directory

  • From: "Drew S" <drew2@xxxxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Mon, 29 Mar 2004 23:31:13 -0500

Hey all... I *should* know of a way to do this, but don't.

Here's the scenario:

I need a way to purge the contents of a certain directory (folder), so that
all files, subdirectories, etc., EVERYTHING is removed from this folder. I
would normally just RMDIR the directory and then recreate it. However, there
are network permissions declared explicitly on this directory, and I can't
afford to have to apply those permissions again, manually. A little more
detail:

Say our user accounts are at:
\\server0\data\users\department\%username%\
Also mapped as i:\users\department\%username% for admins

I need the admins to be able to purge all of the contents of their user
directory (the path listed above), but they cannot purge the directory
itself, as it would be very laborious to manually define each folder's user
permission. Is there a way to tell the system to recursively remove
everything so that it removes everything under the user folder? I don't want
*ANYTHING* to exist under the %username% folder. We are not, however,
purging the data for all usernames - just specific ones. They do happen to
be sequential, though.

BTW, this network uses Novell Netware instead of Windows 2000 Active
Directory, just in case you were thinking of any windows 2000 solutions. All
clients are Windows XP.

I feel stupid for asking this... seems like a very simple problem. I'd like
to integrate this into a batch script so that when the time comes to do this
all over again (this will need to be done like once every 2 months), the
admin can just run the batch file and all of the user files will be purged.
I will, of course, build a safety feature in so that the admin can't
accidentally run the script and make a lot of people angry.

Drew

********************************************************
This Weeks Sponsor StressedPuppy.com Games
Feeling stressed out? Check out our games to
relieve your stress.
http://www.StressedPuppy.com
********************************************************
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: