Delete old unused profiles on XP Pro machins remotely

Posted on 2009-12-22
Last Modified: 2012-05-08
I'm looking for a way to clean off old profiles off of XP Pro computers remotely as quickly as passable, I've been going into the documents and settings folder and deleting them through explorer, but I'm getting a lot of "Cannot delet NTUSER.DAT:" messages and also messages giving the option to skip deleting a specific file. What I want is to delete a bunch of profiles at a time with the least amount of interaction and as quick as possible, does anyone know a way to do this? I'm doing this through remote (dame ware) or preferably by using the \\computer name\c$ access.

Domain environment, XP Pro system, Server 2003 servers.

Thank you,
Question by:dsterling
    LVL 22

    Expert Comment

    With unlocker ( you can delete the files that are in use (in your case the .dat files)

    Author Comment

    ivuz: I've tried unlocker and it requires a great deal of interaction and still will not delete some files.
    LVL 17

    Assisted Solution

    If you're getting 'Cannot delete NTUSER.DAT' message, it probably means that this file is in use.
    This file isn't 'released' upon user logs off from computer. Restart is needed instead.

    You can download the User Profile deletion utility and do it via batch script.
    LVL 22

    Expert Comment

    LVL 2

    Assisted Solution

    yeah defnitly use delprof exe (User Profile deletion utility )

    then use the parameters

    usage:  DELPROF [/Q] [/I] [/P] [/R] [/C:\\<computername>] [/D:<days>]

            /Q      Quiet, no confirmation.

            /I      Ignore errors and continue deleting.

            /P      Prompts for confirmation before deleting each profile.

            /R      Delete roaming profile cache only

            /C      Remote computer name.

            /D      Number of days of inactivity.
    LVL 32

    Accepted Solution

    To complement delprof.exe add this to a batch script and you can run it remotely(manually) or remotely schedule with schtasks.

    REM created by sirbounty,
    @echo off
    for /f "tokens=*" %%a in ('dir c:\docume~1 /b /ad') do call :process "%%a"
    goto :eof
    if [%1]==["Administrator"] goto :eof
    if [%1]==["All Users"] goto :eof
    if [%1]==["Default User"] goto :eof
    if [%1]==["LocalService"] goto :eof
    if [%1]==["NetworkService"] goto :eof
    ::remove the echo from the next line to activate
    ::replace with delprof command to delete the other profiles based upon your data criteria
    echo rmdir %1 /s /q

    Open in new window

    LVL 3

    Expert Comment

    Go to control pannel  System  Advanced tab  on user profiles click Settings  select profiles and click delete

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
    #Citrix #Citrix Netscaler #HTTP Compression #Load Balance
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now