By David Wiseman (Administrator)Created 14 Jan 2006
My Rating:
Vote
Rating:
Not Rated
Views:48281
Downloads:1804

Delete Local Profiles

Language:  VBScript

Description

Delete all the local profiles stored on a computer.(All folders stored in the "C:\Documents and Settings\" folder with a few exceptions added.)


Notes
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. 
Code

Line Numbers: On  Off      Plain Text
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

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
topokin1
Posted On: 7/18/2008 6:45:43 AM

Would there be a way to extend the script to also check the age of the profile before deleting it. For example, that only profiles older than 1 month should be deleted.

tskrich
Posted On: 9/10/2008 12:36:18 PM

Although i do like scripts, There is a Microsoft utility that will let you to delete profiles. I use this on a regular basis.
http://www.microsoft.com/DownLoads/details.aspx?familyid=901A9B95-6063-4462-8150-360394E98E1E&displaylang=en

garish22
Posted On: 1/18/2013 12:36:51 AM

Can I use this script as it is or should change some lines? can you answer fast. I am really in need of this. Thank you, Regards, Gary


Posted On: 11/29/2017 11:44:11 PM

nhl jerseys ugg boots clearance fitflops reebok outlet store ray ban sunglasses ray ban sunglasses michael kors handbags nike foamposite mulberry handbags longchamp pliage coach outlet ferragamo outlet true religion outlet canada goose outlet canada goose jackets polo shirts ugg boots clearance michael kors outlet canada goose jackets polo ralph lauren ugg outlet canada goose jackets cheap snapbacks nike outlet ugg outlet canada goose coats michael kors michael kors outlet thomas sabo canada goose jackets pandora jewelry fitflops sale clearance mont blanc pens canada goose outlet reebok trainers michael kors outlet michael kors black friday moncler jackets christian louboutin online polo ralph lauren air max 90 fitflops shoes oakley sunglasses longchamp outlet polo ralph lauren moncler outlet ugg outlets ugg outlet ray ban sunglasses longchamp bags coach outlet oakley sunglasses ralph lauren polo adidas wings longchamp outlet ugg outlet canada goose jackets christian louboutin shoes coach outlet canada goose outlet uggs outlet nike air max 2015 michael kors outlet pandora jewelry lakers jerseys nike outlet lacoste soldes coach outlet online supra shoes pandora charms sale clearance nike roshe michael kors outlet cazal sunglasses coach outlet kobe bryant shoes new balance shoes ugg outlet nfl jersey wholesale ugg outlet michael kors outlet tory burch outlet air max 90 coach outlet online canada goose outlet coach outlet michael kors handbags prada outlet burberry outlet jordan shoes prada shoes coach factory outlet polo ralph lauren uggs outlet ferragamo outlet tods outlet nba jerseys air max 90 coach outlet ugg boots clearance coach handbags polo ralph lauren michael kors handbags true religion jeans michael kors outlet uggs outlet air max 1 ugg outlet michael kors outlet online coach outlet christian louboutin uk nike air force 1 michael kors outlet oakley sunglasses ray ban sunglasses coach outlet ugg outlet uggs outlet michael kors outlet true religion jeans mcm outlet ugg outlet adidas trainers swarovski crystal kate spade outlet oakley sunglasses ugg boots clearance ugg boots uggs ray ban sunglasses mbt shoes canada goose outlet true religion jeans ferragamo shoes michael kors handbags tory burch outlet tory burch outlet ray-ban sunglasses longchamp solde giuseppe zanotti outlet coach outlet online nike air max canada goose jackets converse shoes ferragamo shoes moncler jackets prada handbags longchamp solde polo ralph lauren nike shoes ugg boots jordan shoes canada goose jackets oakley sunglasses pandora charms sale clearance cheap jordans kate spade outlet oakley sunglasses ray ban sunglasses birkenstock sandals nike store oakley sunglasses soccer jerseys michael kors handbags toms sko coach outlet cheap nhl jerseys ecco shoes oakley sunglasses mulberry handbags polo outlet football shirts ugg cyber monday oakley sunglasses oakley sunglasses marc jacobs outlet vans outlet ed hardy clothing hermes outlet cheap jordans christian louboutin outlet true religion outlet coach outlet swarovski outlet ralph lauren outlet ugg boots clearance michael kors outlet true religion outlet ray ban sunglasses vans shoes longchamp handbags true religion outlet cheap jerseys michael kors outlet swarovski crystal coach handbags michael kors outlet online ray ban sunglasses canada goose jackets coach outlet online polo outlet true religion jeans hermes belt oakley sunglasses wholesale ugg boots coach outlet online bottega veneta outlet ugg boots clearance canada goose jackets prada sunglasses coach outlet longchamp handbags fitflops sale clearance michael kors outlet uggs outlet dansko shoes ray ban sunglasses ray ban sunglasses mulberry bags canada goose outlet links of london tory burch shoes michael kors outlet coach outlet mulberry bags jordan shoes nike store uk ray ban sunglasses michael kors oakley sunglasses christian louboutin outlet ysl outlet burberry outlet michael kors outlet coach outlet canada ugg boots kate spade outlet soccer jerseys ferragamo outlet herve leger outlet ugg outlet cheap nfl jerseys oakley sunglasses oakley sunglasses polo ralph lauren coach outlet ugg outlet michael kors outlet hermes outlet futbol baratas ugg outlet nike outlet ferragamo outlet pandora jewelry ugg outlet converse shoes air max trainers ray ban sunglasses soccer shoes ugg boots chrome hearts cheap jerseys uggs outlet ugg boots adidas sko new balance shoes michael kors outlet online michael kors uk moncler outlet ugg boots clearance swarovski outlet tory burch outlet michael kors outlet canada goose outlet canada goose outlet canada goose outlet air max uk coach factory outlet coach outlet store online oakley sunglasses yeezy boost kevin durant shoes jordan shoes oakley sunglasses coach outlet online ugg outlet polo outlet true religion jeans moncler outlet ralph lauren polo nfl jerseys wholesale mac cosmetics swarovski outlet uggs outlet canada goose black friday tory burch outlet ralph lauren uk yeezy boost 350 ray ban sunglasses christian louboutin shoes longchamp pas cher ugg outlet michael kors factory outlet canada goose parka nike shoes air huarache ugg black friday coach outlet michael kors outlet online swarovski outlet canada goose outlet mulberry outlet adidas uk michael kors outlet online ugg boots canada goose outlet true religion uk michael kors bags coach outlet online salomon shoes canada goose outlet ecco sale canada goose cyber monday michael kors outlet cleveland cavaliers jersey nike free 5 ugg outlet coach factory outlet coach outlet pandora charms uggs outlet canada goose outlet oakley sunglasses canada goose outlet ralph lauren polo true religion jeans michael kors outlet cartier outlet christian louboutin shoes coach outlet online ray ban sunglasses adidas nmd canada goose outlet canada goose jackets burberry outlet montblanc pens adidas outlet store ugg outlet air huarache coach canada ralph lauren uk tory burch outlet ralph lauren outlet true religion jeans fitflops outlet kobe 9 christian louboutin shoes ugg outlet mont blanc pens ralph lauren polo shirts adidas nmd polo ralph lauren kobe shoes lebron james shoes cheap snapbacks ray ban sunglasses puma outlet cheap mlb jerseys ugg outlet ray ban sunglasses puma shoes kate spade outlet oakley sunglasses polo ralph lauren adidas shoes nike air max 90 kate spade outlet ralph lauren polo canada goose outlet true religion jeans fitflops shoes michael kors basketball shoes fitflops coach factory outlet michael kors outlet ralph lauren outlet ugg outlet coach outlet nike trainers coach factory outlet ugg outlet coach outlet online uggs outlet nike trainers polo outlet mulberry handbags ralph lauren pas cher coach outlet oakley sunglasses christian louboutin outlet mulberry handbags canada goose jackets kate spade outlet polo outlet ugg outlet ugg boots clearance michael kors wallets michael kors outlet hermes birkin canada goose outlet timberland boots kicks nice michael kors outlet pandora jewelry mulberry outlet valentino outlet coach factory outlet oakley sunglasses wholesale ray ban sunglasses burberry outlet birkenstock outlet nike factory outlet christian louboutin outlet coach outlet longchamp outlet polo ralph lauren polo ralph lauren cheap mlb jerseys cheap jordans louboutin shoes ugg outlet tory burch outlet nike roshe one nba jerseys canada goose outlet ralph lauren polo shirts canada goose outlet mulberry sale chicago blackhawks jerseys christian louboutin outlet coach outlet oakley sunglasses longchamp handbags oakley sunglasses air max 90 uggs outlet asics shoes fitflops sale clearance lacoste polo shirts canada goose outlet polo ralph lauren canada goose outlet michael kors outlet ugg outlet true religion jeans uggs outlet christian louboutin outlet true religion jeans air jordan 4 michael kors Girls shoes cheap jordans ugg outlet oakley sunglasses chrome hearts outlet polo ralph lauren huaraches shopping ray bans fitflops sale michael kors handbags ugg boots nike trainers coach outlet longchamp handbags canada goose jackets ugg outlet christian louboutin outlet fred perry polo shirts michael kors handbags moncler outlet christian louboutin shoes coach outlet online nike outlet true religion jeans ferragamo outlet nike blazer pas cher 20171130caihuali


Posted On: 12/21/2017 10:11:42 PM



Posted On: 12/26/2017 11:01:17 PM

201712.27wengdongdong ugg outlet moncler michael kors outlet pandora jewelry moncler jassen moncler coach handbags tory burch outlet michael kors outlet ralph lauren outlet supreme adidas stan smith manolo blahnik nike air max ugg boots true religion outlet adidas outlet doudoune moncler moncler coach bags canada goose ugg boots hermes belt nba jerseys ralph lauren outlet north face ray ban sunglasses ray ban sunglasses cheap nhl jerseys ray ban sunglasses ugg boots jordans supreme clothing hollister outlet air jordan pas cher polo ralph north face pandora jewelry fitflops longchamp mont blanc pens blackhawks jersey rolex watches ray ban sunglasses ralph lauren outlet flip or flop ugg boots mlb jerseys ugg australia ralph lauren prada hermes outlet moncler moncler true religion jeans ugg boots michael kors outlet ugg australia coach outlet online ralph lauren tory burch michael kors polo ralph cheap ray ban sunglasses michael kors pandora uk ray ban sunglasses red bottom shoes kate spade outlet kate spade outlet ugg boots on sale polo ralph lauren ugg uk moncler moncler ralph lauren outlet north face supra shoes basketball shoes oakley sunglasses air max birkenstock sandals ray ban sunglasses cheap ugg boots moncler jacka cheap oakley sunglasses jordan retro nike huarache burberry scarf ugg boots kate spade outlet longchamp outlet canada goose jackets polo ralph kate spade handbags north face jackets michael kors handbags north face oakley sunglasses cheap ugg louboutin ralph lauren cheap uggs michael kors outlet louboutin beats by dre longchamp outlet flip flops air jordans ray ban sunglasses ray ban air jordans ugg outlet baseball jerseys canada goose canada goose ferragamo hermes birkin handbags canada goose outlet ugg slippers ralph lauren uk timberland the north face coach outlet adidas stan smith ugg boots michael kors handbags oakley sunglasses nike air max christian louboutin ugg outlet coach outlet timberland outlet ugg boots true religion outlet burberry outlet north face ferragamo coach factory outlet polo ralph lauren coach outlet ugg outlet canada goose coach outlet store online nike outlet ugg outlet new balance shoes canada goose jordan shoes coach outlet ray ban sunglasses fitflops ugg boots adidas football boots coach outlet coach outlet store michael kors outlet jordan shoes ugg boots clearance pandora jewelry michael kors tory burch outlet ralph lauren michael kors handbags moncler jackets ugg outlet canada goose outlet calvin klein outlet jordans burberry handbags north face jordans converse outlet jordan the north face nike air max ray ban sunglasses swarovski jewelry oakley sunglasses ugg outlet true religion jeans juicy couture outlet tommy hilfiger canada coach outlet ugg boots on sale canada goose outlet nike huarache bottes ugg coach factory outlet moncler ugg boots kate spade outlet moncler jackets burberry scarf supreme new york cheap nfl jerseys coach factory outlet coach outlet true religion canada goose ugg outlet ugg outlet oakley sunglasses ugg boots pandora charms michael kors outlet cheap ugg boots the north face timberland nike free run ugg outlet store canada goose outlet uggs outlet ugg outlet michael kors sac longchamp timberland mont blanc pens michael kors outlet under armour outlet christian louboutin coach outlet canada goose uk north face outlet snapbacks hats wholesale north face air max canada goose uk ray bans michael kors outlet ugg boots clearance coach outlet ugg outlet canada goose outlet adidas shoes nike air max red bottom shoes canada goose outlet north face north face outlet north face outlet nike football boots tory burch outlet uggs outlet moncler outlet coach outlet online replica watches ralph lauren longchamp canada goose nfl jerseys ugg outlet oakley sunglasses christian louboutin oakley sunglasses ugg boots canada goose nike air force 1 ralph lauren outlet coach outlet online ugg australia prada outlet polo ralph lauren salvatore ferragamo hermes pandora charms ugg boots nike air oakley sunglasses vibram fivefingers christian louboutin north face outlet nike air max ugg nfl jerseys canada goose outlet michael kors michael kors handbags burberry outlet ralph lauren outlet canada goose outlet nike store nike shoes uggs outlet canada goose ugg outlet mbt jordans air jordan superdry clothing louboutin uggs outlet ugg factory outlet ralph lauren nike air max adidas yeezy boost uggs michael kors outlet mlb jerseys coach outlet michael kors outlet ralph lauren outlet oakley sunglasses michael kors birkenstock sandals birkenstock outlet nfl jerseys ray ban sunglasses ugg boots on sale cheap nfl jerseys ugg outlet ugg clearance moncler pandora charms coach wallets ugg boots jordan shoes jordans uggs louboutin coach outlet online mulberry uggs outlet louboutin jordans soccer jerseys ugg nike outlet coach outlet hollister clothing ugg outlet nike factory outlet hogan adidas shoes ugg boots north face fitflops giuseppe zanotti michaelkors outlet moncler coach outlet the north face ugg boots adidas jeremy scott canada goose jassen timberland boots canada goose prada nike trainers canada goose jackets michael kors outlet cheap jerseys kate spade burberry scarves coach outlet ugg boots christian louboutin michael jordan shoes jordan shoes mbt pandora jewelry ralph lauren outlet goedkope uggs canada goose adidas cheap jordans michael kors outlet ugg australia pandora charms louboutin michael kors ugg boots christian louboutin coach outlet online longchamp pandora rings coach outlet ralph lauren ugg boots ugg boots canada goose outlet nhl jerseys mlb jerseys true religion burberry outlet nike outlet nike outlet mont blanc fitflops coach outlet adidas wings nike tn prada outlet oakley sunglasses north face jackets clearance nike blazer shoes coach outlet online north face uk adidas 201712.27wengdongdong


Posted On: 1/24/2018 5:46:06 PM

insanity swarovski adidas zx mac makeup canada goose burberry outlet jordans ugg boots moncler jackets adidas outlet pandora charms flops true religion outlet converse shoes true religion outlet jordan juicy couture swarovski basketball shoes air max 2017 cartier love bracelet michael kors wedding dresses prada parajumpers cheap nfl jerseys air max ralph lauren moncler ray ban outlet rolex watches nike roshe run michael kors outlet uggs outlet michael kors oakley vault ugg boots salomon shoes mizuno wave air max flip flops michael kors hogan chi flat iron montre pas cher herve leger nike air huarache ray ban ray ban nike air longchamp north face reebok bcbg max tommy hilfiger prada outlet michael kors outlet online store cheap ugg boots the north face canada goose replica watches pandora montre canada goose oakley vault reebok pandora oakley sunglasses vanessa bruno cheap eyeglasses nike air max puma shoes oakley new balance shoes sac burberry nike store cheap nfl jerseys vans shoes nike store nike store guess ed hardy new balance wedding dresses michael kors oakley sunglasses ugg nike shoes dolce and gabbana air jordan nike trainers polo ralph lauren sac longchamp nike free run oakley sunglasses cheap tommy hilfiger adidas trainers north face outlet oakley vault nike air celine air max hermes outlet links of london roshe run asics air max 95 oakley sunglasses nike free roshe run north face ugg boots longchamp michael kors borse kobe 9 nike air force ralph lauren outlet ralph lauren hollisterco cheap air jordan soccer shoes moncler wedding dresses ugg boots moncler ferragamo ray ban sunglasses timberland boots roty burch outlet converse free run hollister coach outlet online ray ban jimmy choo ray ban hollister canada goose jackets baseball bats ralph lauren uk mulberry coach outlet the north face michael kors outlet adidas superstar guess soccer jerseys beats headphones marc jacobs longchamp handbags tommy hilfiger nike free juicy couture rolex watches kobe 10 mac cosmetics ugg converse uggs outlet levi's jeans ugg boots ugg boots lebron james shoes kevin durant shoes juicy couture outlet ray ban sunglasses dansko shoes ugg australia michael kors outlet pandora jewelry louboutin longchamp bags ralph lauren valentino christian louboutin mizuno running shoes timberland shoes nike mercurial nike air max nike outlet uggs outlet michael kors outlet bottega oakley roty burch outlet online ralph lauren moncler outlet converse coach factory outlet bottes ugg new balance adidas uk adidas nike free michael kors moncler fendi hollister kate spade outlet michael kors outlet cheap uggs burberry outlet hollister new balance trainer nike ray ban ghd louboutin nike blazer pas cher red bottoms nike roshe run michael kors outlet burberry outlet store moncler jackets hermes swarovski true religion jeans coach purse karen millen uk longchamp air max hollister michael kors handbags ugg boots fivefingers nike mercurial jordan ray ban sunglasses birkin bag ray ban sunglasses mac makeup nike air max nike air max polo lacoste ray ban sunglasses sac michael kors rolex wedding dresses roshe run beats by dre timberland boots kate spade giuseppe zanotti ralph lauren outlet moncler louboutin ferragamo oakley nike roshe run pas cher pandora jewelry canada goose outlet jordan shoes vans marc jacobs converse ugg outlet true religion jeans huarache north face rolex stuart weitzman nike air force timberland oakley sunglasses burberry outlet online asics nike tn longchamp pandora thomas sabo ugg hogan outlet mont blanc jordan lebron 11 north face pas cher oakley sunglasses montblanc kate spade outlet asics polo ralph lauren timberland lebron shoes true religion louboutin nike air max flip flops ugg canada goose ferragamo jordan shoes ray ban sunglasses canada goose jackets adidas shoes ugg australia tods canada goose louboutin louboutin pas cher hollister sac guess beats by dre nike free montre homme new balance mac cosmetics polo ralph lauren uggs omega watches vans supra tory burch outlet coach outlet store online michael kors outlet christian louboutin vans shoes instyler ionic styler air max michael kors canada barbour mulberry outlet balenciaga nike blazer michael kors outlet jordan retro true religion jeans swarovski uk air jordans nike shoes 2018.1.25xukaimin


Posted On: 3/15/2018 7:46:17 PM



Posted On: 3/30/2018 5:35:15 AM

2018331 leilei3915 cheap ray ban hermes outlet cheap nfl jerseys coach outlet moncler sale pandora outlet fred perry polo shirts ray-ban sunglasses michael kors outlet pandora outlet michael kors outlet oakley sunglasses ralph lauren outlet mulberry bags supreme shirts cheap ugg boots ralph lauren coach factory outlet ralph lauren uk ugg boots clearance canada goose outlet online ralph lauren lebron james shoes fitflops sale clearance michael kors outlet canada goose jackets ralph lauren outlet michael kors outlet clearance pandora jewelry polo outlet supreme hoodie michael kors official site prada outlet stores coach outlet store online ray ban wayfarer coach outlet online canada goose jackets adidas yeezy boost christian louboutin outlet canada goose jackets canada goose jackets nike outlet supreme outlet polo ralph lauren outlet oakley sunglasses canada goose jackets adidas yeezy boost michael kors outlet fred perry polo michael kors outlet clearance polo ralph lauren factory store canada goose jackets coach outlet online pandora charms outlet adidas outlet ugg outlet ugg boots coach outlet online nfl jerseys wholesale kate spade handbags pandora charms outlet ralph lauren polo michael kors outlet online pandora charms tory burch outlet online coach outlet store online mbt outlet ugg boots clearance cheap oakley sunglasses cheap jordans tory burch handbags polo ralph lauren coach outlet coach outlet pandora pandora outlet store nfl jerseys wholesale tory burch shoes pandora jewelry canada goose michael kors outlet canada goose outlet store fred perry shirts michael kors outlet michael kors outlet clearance canada goose outlet online coach factory outlet cheap ugg boots pandora jewelry cheap oakley sunglasses coach outlet canada goose jackets valentino outlet kate spade outlet online canada goose adidas outlet store coach outlet michael kors outlet ugg boots coach factory outlet online