I generally have a lot of users who log in and out of machines and the “c:\documents and settings” folder gets clogged up with gigabytes of data over time.
To delete the user profiles on a machine you can use a little utility called Delprof which is a microsoft tool. I generally copy the delprof.exe file to my c:\windows\system32 folder on the machines that I manage so that typing the command delprof /Q /I into a run Window or a command prompt will start deleting the users profiles which reside on the system. Really useful if you need to take a quick image of a machine and want to clean up the documents and settings area immediatly.
To schedule delprof to run every weekday open a command prompt window and type:
at 16:00 /every:Monday,Tuesday,Wednesday,Thursday,Friday “delprof /Q /I”
For the above to work the delprof.exe will need to be in your path somewhere (eg. C:\windows\System32)
You can also copy the below text into notepad and and save it as delprof.vbs. Running it will copy the delprof.exe file from somewhere on your network chose to the c:\windows\system32 folder. It will then schedule a “delprof /Q /I” task to run every Tuesday, Thursday and Saturday.
——— Start Copy Here ———
Const OverwriteExisting = True
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
objFSO.CopyFile “\\servername\ShareName\Utilities\Delprof\delprof.exe” , “C:\Windows\system32\”, OverwriteExisting
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)
Set objNewJob = objWMIService.Get(“Win32_ScheduledJob”)
errJobCreated = objNewJob.Create _
(“delprof /Q /I”, “********220000.000000-420″, _
True , 1 OR 4 OR 16, , , JobID)
Wscript.Echo errJobCreated
———End Copy Here ———
If you get a Script error like the below it means the file your trying to copy from your file share does not exist.

A successful completion should show:

When I was testing this script under vista I noticed that the Windows Script Host was showing a 2 instead of a 0. This was because the vbscript was not run from an elevated Command prompt (right click command prompt icon and select “Run as Administrator”. If you are going to run under vista please test it fully as I have not had an opportunity to do so.