DELPROF (XP/2003 Server Resource Kit - download)

Delete windows user profiles.

Does not work with Windows 7 or later. A good alternative is Helge Klein's Delprof2.
Delprof2 is syntax compatible with the original Delprof by Microsoft.

In the Windows 10 GUI right-click My Computer | Properties | Advanced System Settings | User Profiles | account | Delete

Syntax
      DELPROF [options days]

Key
   /Q      Quiet, no confirmation.

   /I      Ignore errors and continue deleting.

   /P      Prompts for confirmation before deleting each profile.

   /C:\\computer_name
           Delete profiles on a remote computer.

   /D:Number_of_days
           Only delete profiles that have been inactive for
           'X' Number of days (or greater)

   /R      Delete roaming profile cache only

Example:

delprof /D:14

Run Delprof2 on a remote PC (with PowerShell)

PS> Invoke-command -computername 'workstation64' -scriptblock {& "C:\utils\delprof2.exe" '/q'}

“The best way to destroy the capitalist system is to debauch the currency” ~ John Keynes

Related:

WMI/PowerShell script to delete user profiles - Idera
Delprof2 - Delete Profiles Utility (Helge Klein)
DELTREE - Delete a folder and all subfolders
RD - Delete folders or entire folder trees


Copyright © SS64.com 1999-2018
Some rights reserved