The principle is to enumerate all profiles on the computer. Then discard all local profiles and the admin profiles (SID ends with -500). Then use the user registry hive file NTUSER.DAT to check when it was last accessed. Calculate the difference between that date and today to see whether the profile is above the delete-threshold. Then delete the profile directory and remove the appropriate registry key.
_________________________
There are two types of vessels, submarines and targets.