Some may find this handy....
You will need to compile it first - [ I did it in AutoIT ]
When run it will delete all the files & folders in the directory apart from the folder 'keep me'
I run this every year on our students home directories.
Code:
$search = FileFindFirstFile("*.*")
; Check if the search was successful
If $search = -1 Then
MsgBox(0, "Error", "No files/directories matched the search pattern")
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error <> 0 Then ExitLoop
If $file = "keep me" Then ContinueLoop
If $file = "." Or $file = ".." Then ContinueLoop
If StringInStr(FileGetAttrib(@SCRIPTDIR & "\" & $file) , "D") Then
DirRemove($file, 1)
Else
FileDelete(@SCRIPTDIR & "\" & $file)
EndIf
WEnd
FileClose($search) If you want a compiled version - just ask and I'll copy it up...