Ok, here is the meat of the revised script:
Code:
Break ON
$ = SetOption("WrapAtEOL","ON")
? "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
? "!! ENSURE THIS SCRIPT IS BEING RUN FROM SAFE MODE !!"
? "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + @CRLF
? "Determining OS Type... "
IF INSTR(@PRODUCTTYPE, "XP") OR INSTR(@PRODUCTTYPE, "2000")
? @PRODUCTTYPE + @CRLF + @CRLF
$path = %SystemDrive% + "\Temp"
DirFileWipe($path)
$path = %WinDir% + "\Temp"
DirFileWipe($path)
ELSE
? "This script is only configured for Windows 2000/XP"
ENDIF
Sleep 15
EXIT
function DirFileWipe($path)
IF EXIST ($path)
? "- Wiping temp folder: " + $path
$DirList = DirList($path,4+2+1)
FOR EACH $x in $DirList
DEL $x /h
NEXT
$DirList2 = DirList($path,4+2+1)
FOR EACH $x in $DirList2
SHELL "%COMSPEC% /c RD /S/Q $x"
? @SERROR
NEXT
? "- $path was wiped successfully..." + @CRLF
ELSE
? "- $path did not exist..."
ENDIF
endfunction
In my DirFileWipe() function, how could I run a check on the passed directory to see if I had the ability to scan it.
IF $DirList <> 0 doesn't evaluate correctly. Looking back at that UDF, I didn't see it reporting error codes on success or failure. Any thoughts?