:: Purpose: Deletes old cached user profiles in Windows 2000/XP for all of our teams computers
:: Requirements: 1. Run this script with network admin rights
:: 2. delprof.exe from Microsoft must be in any of these locations:
:: a) the directory you run this script from
:: b) in the PATH variable
:: c) c:\windows\system32\
:: Author: Habur Gate (hgate73 at live dot com)
:: Version: 1.0
:: History: 1.0 Initial write
:: Notes: Edit the list of system names below (where the script performs the delete) to reflect your own system names
:: Prep
@echo off
title Orbital Cached Profile Nuker
set VERSION=1.0
cls
:: User notice
color 0c
echo.
echo *********************************************************
echo * *
echo * ORBITAL CACHED PROFILE NUKER (OCPN) *
echo * ----------------------------------------------------- *
echo * Nuke them from orbit. It's the only way to be sure. *
echo * *
echo * RULES for a safe and happy nuking: *
echo * 1. Run this script with NETWORK ADMIN rights. Local *
echo * admin rights won't work. *
echo * 2. Run this script from the desktop, NOT a network *
echo * path. *
echo * 3. "delprof.exe" must be in the same directory as *
echo * this script. If you don't have it, Google and *
echo * download it. *
echo * *
echo *********************************************************
echo.
echo The next screen will let you set the number of days.
echo.
pause
color 07
cls
:: Ask user how many days old the profiles should be before getting nuked
echo.
echo *********************************************************
echo * *
echo * IT'S NUKING TIME *
echo * ----------------------------------------------------- *
echo * Windows 2000/XP caches user profiles when you login. *
echo * Over time these use up a lot of space. Annoying. *
echo * *
echo * This script deletes those old profiles by using *
echo * "delprof.exe" from Microsoft. *
echo * *
echo * After you enter the number of days and hit "enter" *
echo * the script will begin nuking! *
echo * *
echo *********************************************************
echo.
set /p DAYS=Nuke profiles older than how many days? (21 recommended):
:: HIROSHIMA!
title Nuking profiles, please wait...
cls
echo.
echo Nuking cached profiles older than %DAYS% days. Please wait for radiation to clear...
echo.
delprof /Q /I /C:\\dt114601 /D:%DAYS%
delprof /Q /I /C:\\dt33202 /D:%DAYS%
delprof /Q /I /C:\\dt33210 /D:%DAYS%
delprof /Q /I /C:\\dt37711 /D:%DAYS%
delprof /Q /I /C:\\nb653001 /D:%DAYS%
delprof /Q /I /C:\\dt653001 /D:%DAYS%
delprof /Q /I /C:\\dt653002 /D:%DAYS%
delprof /Q /I /C:\\dt653003 /D:%DAYS%
delprof /Q /I /C:\\dt653004 /D:%DAYS%
delprof /Q /I /C:\\dt67806 /D:%DAYS%
delprof /Q /I /C:\\dt67808 /D:%DAYS%
echo.
echo Done nuking. Profiles older than %DAYS% were obliterated.
echo.
pause