The most likely problems are that the directory you specified doesn't exist because of the current directory, or the directory is in use.
A quick test is to add a debug call on the line just
before the Delete:
Gosub Debug
At the end of your procedures add this:
Debug:
Set Current Bitmap 0
Set Camera View 0,0,1,1
CLS
Rem Place any debug info you want to display here...
Print DirectoryNameToDelete$
DIR
End
Return
When you run the program, at the point you
would have deleted the directory, the program will stop and print the name of the directory it thinks it will be deleting, followed by the contents of the current directory.
Check in Windows Explorer that the directory name that was printed actually exists.
If you don't use the full path, but instead use a relative path (or no path, just the directory name), then the folder name should appear on the DIR list.
With this you should be able to figure out what's going on.
The Debug procedure method can be used to find many problems by altering the information that gets printed when the procedure is called.
TDK_Man