+ Post New Thread
Results 1 to 3 of 3
Windows Server 2000/2003 Thread, Delete folders with exceptions in Technical; In the documents and settings folder there is a long list of old user folders. I need to delete everything ...
  1. #1

    Join Date
    Dec 2010
    Location
    Watertown
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Delete folders with exceptions

    In the documents and settings folder there is a long list of old user folders. I need to delete everything but the "admin", "all users" and "default user" folders...

    Here is the bat file I have, but I can't get it to exclude anything:
    for /D %%j in ("C:\documents and settings\*") do RD /S /Q "%%j"

  2. #2

    Join Date
    May 2008
    Location
    York
    Posts
    515
    Thank Post
    22
    Thanked 49 Times in 46 Posts
    Rep Power
    25
    i have a vb script at work for this will dig it out and post it in morning

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,909
    Thank Post
    3,435
    Thanked 1,084 Times in 1,000 Posts
    Rep Power
    370
    Use delprof - much easier

    As long as you don't have roaming profiles you can make the users a member of either the local or domain guest group which by design will delete there profile at log off.

    If you use roaming profiles and do the above ref making them a member of the guest group it wont copy the profile back to the server and will delete it ( as per another thread on edugeek )

SHARE:
+ Post New Thread

Similar Threads

  1. vb script to delete sub folders
    By ful56_uk in forum Scripts
    Replies: 1
    Last Post: 30th April 2010, 10:46 PM
  2. search folders and delete
    By mweller2000 in forum Scripts
    Replies: 0
    Last Post: 23rd April 2009, 07:24 PM
  3. Script to delete specific folders
    By Baasha_Bhai in forum Scripts
    Replies: 8
    Last Post: 2nd July 2008, 10:41 AM
  4. VB script to delete certain folders
    By PTD in forum Scripts
    Replies: 7
    Last Post: 4th June 2008, 12:30 PM
  5. Script to delete certain folders
    By Pumaedition in forum Scripts
    Replies: 4
    Last Post: 22nd April 2008, 10:08 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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