Here's my attempt at removing the stored profiles from the computers.

The whole script also removes unwanted applications (Messageing, audio gal, etc) and adds applications that are needed.

It also (sounds good) rebuilds the startmenu using a cache of icons stored on the network.

Anyway here's the bit your interested in, if you want the whole script, let me know.

code:
; The dir where the profiles are stored
$dir = "C:\Documents and Settings\"

cd $dir

COLOR g+/n
? "Round 1"
COLOR w+/n

gosub EmptyProfilesdir

COLOR g+/n
? "Round 2"
COLOR w+/n

; Run it twice, incase it missed anything
gosub EmptyProfilesdir




EXIT 1



;*******************************************************************
;EmptyProfilesDir - Remove the contents of the Profiles dir except the standard folders
;*******************************************************************

:EmptyProfilesdir

Dim $SubDir
$Filename = Dir("*.*")
While $Filename <> "" And @Error = 0
If SubStr( $Filename , 1 , 1) <> "."
If GetFileAttr( $Filename ) & 16
$SubDir = $Filename
if $subdir = "Administrator"
? "Cannot remove $subdir Directory." ?
else
if $subdir = "All Users"
? "Cannot remove $subdir Directory." ?
else
if $subdir = "bob"
? "Cannot remove $subdir Directory." ?
else
if $subdir = "Default User"
? "Cannot remove $subdir Directory." ?
else
CD $SubDir
GoSub EmptyProfilesdir
CD ".."
$Filename = Dir("*.*")
While $Filename <> $SubDir
$Filename = Dir()
Loop
if $subdir = "Administrator"
? "Cannot remove $subdir Directory." ?
else
if $subdir = "bob"
? "Cannot remove $subdir Directory." ?
else
if $subdir = "All Users"
? "Cannot remove $subdir Directory." ?
else
if $subdir = "Default User"
? "Cannot remove $subdir Directory." ?
else
COLOR r+/n
? " $subdir empty...Removing..."
rd $subdir
COLOR w+/n
"Done."
endif
endif
endif
endif
endif
endif
endif
endif

$Err = SetFileAttr( $SubDir , 128 )
Else
$Err = SetFileAttr( $Filename , 128 )
$Extension = SubStr( $Filename , Len($Filename) - 3 , 4 )
;Select
;Case $Extension = ".*"
Del $Filename
? " Deleting $Filename "
"Done."
;EndSelect
Endif
Endif
$Filename = Dir()
Loop

RETURN

Hope this helps

[Smile]

[ 02 May 2002, 10:05: Message edited by: Ghost ]
_________________________
Who are you? Who slips into my robot body and whispers to my ghost?