Jump to content

Recommended Posts

Posted

Hi.

 

I need ur help in this one...

 

My folder structure looks like this:

 

Mustermann.Max

Desktop

Anwendungsdaten

...

Example.Daniel

Desktop

Anwendungsdaten

...

Test.Susan

Desktop

Anwendungsdaten

...

 

Thats some regular Home-Drives. As my schools storage space is nearly full we decided to reset all folders and files to 0 until we can afford more HDDs (Austrian school budgets are really bad).

 

My goal is now to keep the folder in example "Mustermann.Max" since it has all the right privileges set and i only want to delete everthing in it.

I have more than 1800 Accounts so i don't want to do it by hand.

Deleting the Profiles is no problem since the folders create itself with the right attributes when logging on.

 

Does anyone have a handy script or knows a tool that is able to do what i want.

 

Thanks in Advance

Ban4na

  • 2 weeks later...
Posted

you could try something like

 

del Mustermann.Max\* /s

 

This will delete all files in the directory and sub directories, but leave the folder itself alone.

 

the 'del' is delete, and then i look at modifies or variables found here Microsoft Corporation

 

I would still make a few test folders to try it on first :D

Posted (edited)

look at delprof2 it might do what your looking for but might still require run on each machine, we have large churn of users so as they login to each machine profile directories are created cna get upto couple of hundred profile directories on some machines, I used that over the summer in a summer2013 login script just went round to each machine and logged in, done chkdsk, delprof and defrag, as part of our summer clean out.

 

Delprof2 - User Profile Deletion Tool

Be very careful with this, i have 20 odd years non-experience with computers and still managed to delete my profile directory and documents i needed using this.

Edited by mikeyd101
Posted

Here is a simple Poweshell script that I've used in the past, just edit the $rootPath variable to reflect your own path to the student user directories

 


$RootPath = "\\servername\path to share" #location of user directories

(Get-ChildItem $RootPath -Directory).Name | ForEach-Object {Get-ChildItem "$RootPath\$_" -Recurse | Remove-Item -Recurse -Force}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...