+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Deleting everything in Home-drives in Coding and Web Development; Hi. I need ur help in this one... My folder structure looks like this: Mustermann.Max Desktop Anwendungsdaten ... Example.Daniel Desktop ...
  1. #1
    Ban4na's Avatar
    Join Date
    Apr 2013
    Location
    Innsbruck, Austria
    Posts
    2
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Deleting everything in Home-drives

    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. #2

    Join Date
    Sep 2013
    Location
    Wyoming
    Posts
    32
    Thank Post
    2
    Thanked 5 Times in 4 Posts
    Rep Power
    2

    del

    you could try something like

    Code:
    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

  3. #3

    Join Date
    Jan 2013
    Posts
    96
    Thank Post
    23
    Thanked 11 Times in 10 Posts
    Rep Power
    4
    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.
    Last edited by mikeyd101; 24th February 2014 at 08:50 PM.

  4. #4
    old_n07's Avatar
    Join Date
    Jun 2012
    Location
    North Staffordshire
    Posts
    97
    Thank Post
    10
    Thanked 16 Times in 14 Posts
    Rep Power
    7
    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

    Code:
    $RootPath = "\\servername\path to share" #location of user directories
    
    (Get-ChildItem $RootPath -Directory).Name | ForEach-Object {Get-ChildItem "$RootPath\$_" -Recurse | Remove-Item -Recurse -Force}

SHARE:
+ Post New Thread

Similar Threads

  1. New folders in Home Drives - Ownership
    By Fleetwood in forum Windows Server 2008 R2
    Replies: 3
    Last Post: 11th July 2013, 12:58 PM
  2. Script To Delete Folder in Home Area
    By FN-GM in forum Scripts
    Replies: 4
    Last Post: 16th May 2013, 11:43 AM
  3. replacing files and folders ownership in home drives
    By Bertv in forum Windows Server 2000/2003
    Replies: 4
    Last Post: 17th November 2011, 01:01 AM
  4. Mapped Home Drives in School, But not for home
    By stevenwba in forum Windows
    Replies: 6
    Last Post: 6th May 2010, 09:59 PM
  5. Replies: 6
    Last Post: 31st July 2008, 03:25 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •