hi, just a couple of observations..
1. delprof.exe is a very useful for sticking in batches ( got some handy switches /c: (remote computer) /d: (days inactive) etc.)
2. remember NEVER to run it on a laptop. lol
3. you can compound your case statements...
Code:
select case foldername
case "All Users", "Default User", "LocalService", "NetworkService", "Administrator"
isException = True
case Else
isException = False
End Select
4. to make it a bit more robust for a production environment it may be a good idea to rename the folder first, then delete. WHY?
Ever tried to delete a profile and ntuser.dat was locked? then you had to restart to delete it?
with the script as it is (and delprof for that matter) it would result in a half deleted (corrupt) profile. if you had a rename element in the script the rename function would fail and not proceed to delete the profile. Ergo the profile still works and when the PC is next rebooted the script should work as expected