No announcement yet.

Deleting Documents and Settings Folder

  • Filter
  • Time
  • Show
Clear All
new posts

  • Deleting Documents and Settings Folder


    I am very inexperienced at scripting so I would apperciate any insight you can offer.

    I work for school district where all the workstations run Windows XP SP2 in a Novell server environment. We have 3000 students log in on our workstations every year so the documents and settings folders are getting so large that the workstations are running out of disk space. I had hoped to use Delprof to delete profiles that are over 200 days old but I need to keep certain account folders that do not get used often like Administrator and Vendor. Does anyone know a command I can use to flag these needed folders not to be deleted by Delprof?

    If delprof will not work could I configure a script that would delete the student folders based on there names? Our staff account folders are named first initial last name (jsmith) and our student accounts are named for the student name and student ID (jsmi989). The script would need to be able to delete all of the folders with numbers in the title and leave the rest is it possible to search this way in a script?

    Thank your for any help or advice you can offer.

  • #2
    Re: Deleting Documents and Settings Folder

    So after some playing around I figured out that if I set the folder as System and Hidden they will not be deleted by delprof. If I put the commands into a bat file everything works fine but I am prompted by Delprof "Delete inactive profiles? yes/no" even though I am using the /q switch. When I run these commands manually from a command window it works correctly. Does anyone know what I am doing wrong to make the script prompt when I run the commands in a .bat?

    Here it the bat file.

    Attrib +S +h "C:\Documents and Settings\vendor"
    Attrib +s +h "C:\Documents and Settings\Administrator"

    DelProf /q /i /D:185

    Attrib -S -h "C:\Documents and Settings\vendor"
    Attrib -s -h "C:\Documents and Settings\Administrator"