Dear,

Why not using the deltree command?

Reading the information from a file is much slower. You think the amount of files can be
very big (see array size of 99.999 elements).
Files with special attributes (line: ReadOnly) will not removed by del or rd commands.
First you need to change those file attributes.
For W9x systems you had also to deal with the known problem of flushing
write-buffers to your disk.

deltree doesn't have problems with special file attributes, flushing buffer
problem within w9x environments and can bypass possible open files.

Our version:

code:

CLS
BREAK ON
:wrong
? "This will Delete all files and Directories in"
? "%temp%!!! are you sure?(y/n)"
GET $yn
SELECT
CASE (LCase($yn) = "y")
;run rest of code
CASE (LCase($yn) = "n")
EXIT
CASE 1
GOTO wrong
ENDSELECT
SHELL '%comspec% /c deltree /y %temp%\.'
IF (Exist(%temp%) = 0)
MD %temp%
ENDIF

See our script cleanup.kix for other ideas about cleaning an user environ-
ment.
greetings.

btw: deltree program and cleanup.kix script you can find on
our site http://home.wanadoo.nl/scripting

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA