1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Delete Profiles VBS Script

Discussion in 'Software Development' started by Eadinator, Apr 4, 2010.

Mark Solved
Thread Status:
Not open for further replies.
  1. Eadinator

    Eadinator Guest Thread Starter

    I have acquired a script from the internet which deletes all the locally cached profiles on a computer if they are not on the specified list of exceptions.

    By default, I think it does something like this:

    Gets all the folders in the 'Users' directory > Goes through the list of exceptions > Deletes all the folders which aren't on the list of exceptions > If a folder can't be deleted, it leaves it behind and goes onto the next one. (This means it doesn't hang).

    This is ok, but a lot of the time, profiles with incorrect owners are present. In this case, the script won't be able to delete the profile, will move onto the next one, leaving it behind. I need all the folders which are non-exempt to be deleted.

    I need it to do the following:

    Get all the folders in the 'Users' directory > Go through the list of exceptions > Change the owner of all folders which are non-exempt > Delete all folders which are non-exempt (which it should be able to do at this point) > In case of some unknown error, go onto the next one (for the sake of it not hanging).

    I have had a go at this myself, but I haven't quite got it. Note: I may need to set the permissions as well, but if I can get it to set the owner, I can simply add the permissions bit as a switch on the subinacl command.

    I have attached the script. Please let me know if you need any more information and thanks for any help with this.

    Matthew.
     

    Attached Files:

    • del.zip
      File size:
      511 bytes
      Views:
      157
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/914682

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice