sub DeleteFolder folder$
struct shfo, hwnd as ulong, wFunc as ulong, pFrom as ptr, pTo as ptr, _
fFlags as ulong, fAnyOperationsAborted as long, _
hNameMappings as ulong, lpszProgressTitle as ptr
confirm "Are you sure?"; answer$
if answer$ <> "yes" then exit sub
FO.DELETE = 3
FOF.ALLOWUNDO = 64
shfo.wFunc.struct = FO.DELETE
shfo.pFrom.struct = folder$ + chr$(0)
shfo.fFlags.struct = FOF.ALLOWUNDO
calldll #shell32, "SHFileOperationA", shfo as struct, res as long
if res then notice "File or folder could not be deleted"
end sub