< -- BuySellAds Ad Code ALLEN -->
  • Home
  • General
  • Delete Local Profiles In Windows XP With VBS
IT Tutorials

Delete Local Profiles In Windows XP With VBS

Problem

If a lot of different users use your desktops and their profiles are quite large then you will soon find that your desktops run out of drive space due to these large profiles. Ive seen this quite often in a school environment. We need to find a way of clearing down these profiles quickly and efficiently.

Here is How To Delete Local Profiles In Windows XP. Its in VBS

 

 

 

Resolution

Here is a simple VBS script. To use simply copy the conents of the txt below into notepad and save the file as “deleteprofiles.vbs”

Const LocalDocumentsFolder = “C:\Documents and Settings\”</p> <p>set objFSO = createobject(“Scripting.FileSystemObject”)<br /> set objFolder = objFSO.GetFolder(localdocumentsfolder)</p> <p>on error resume next</p> <p>for each fldr in objFolder.SubFolders<br /> if not isexception(fldr.name) then<br /> objFSO.DeleteFolder fldr.path, True<br /> end if<br /> next<br /> Function isException(byval foldername)<br /> select case foldername<br /> case “All Users”<br /> isException = True<br /> case “Default User”<br /> isException = True<br /> case “LocalService”<br /> isException = True<br /> case “NetworkService”<br /> isException = True<br /> case “Administrator”<br /> isException = True<br /> case Else<br /> isException = False<br /> End Select<br /> End Function

YOu could run this script as a shutdown script via a gpo at the end of each day.

Tags: Vista, Windows 7, XP

Allen White

Allen is an IT Consultant and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5, 6 and HP ASE, AIS - Network Infrastructure.

Leave a comment

Categories

Vote!

What Web Browser Do You Use?

View Results

Loading ... Loading ...

Vote!

What do you prefer..VMware or Hyper-V?

View Results

Loading ... Loading ...