October 31, 2025, 06:34:44 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


delete folders

Started by splakidas, June 07, 2009, 11:28:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

splakidas

How can i delet folders, subfolders and files that are in the subfolders ?

billhsln

This is what I use, I did not write this and it was originally from IBasic:

sub DelTree(path as string)
Dim H,N,problem:Int
Dim Name:String
if path<>""
H=FindOpen(Path+"\\*.*")
If H
Do
Name=FindNext(H)
If (Name <> "") and (Name <> ".") and (Name <> "..")
DelTree(Path+"\\"+Name)
EndIf
Until Name = ""
FindClose H
EndIf

N=FindOpen(Path)
If N
FindClose N
DeleteFile(Path)
if (right$(Path,1) <> "\\")
problem=RemoveDir(Path)
if (problem = 0) then print Path, " Path Not Deleted"
endif
endif
endif
return
endsub


Bill
When all else fails, get a bigger hammer.

splakidas