Delete Local Profiles
Delete all the local profiles stored on a computer.(All folders stored in the "C:\Documents and Settings\" folder with a few exceptions added.)
This script could be run as a start-up or shutdown script to stop windows saving copies of user profiles.
Please note that there is a group policy setting to delete cached copies of roaming profiles, and running this script might impact logon performance.
Please use this script with particular caution as it has the potential to delete user documents if folder redirection is not used.
Const LocalDocumentsFolder = "C:\Documents and Settings\"
set objFSO = createobject("Scripting.FileSystemObject")
set objFolder = objFSO.GetFolder(localdocumentsfolder)
on error resume next
for each fldr in objFolder.SubFolders
if not isexception(fldr.name) then
objFSO.DeleteFolder fldr.path, True
end if
next
Function isException(byval foldername)
select case foldername
case "All Users"
isException = True
case "Default User"
isException = True
case "LocalService"
isException = True
case "NetworkService"
isException = True
case "Administrator"
isException = True
case Else
isException = False
End Select
End Function