How To Delete a Folder From HardDisk

Hi All Experts, I have a folder which content some files. Now I want to delete the folder through lotus script.

Now I am using

RMDIR “c:\test”

It deleting the folder if the folder not contain any file.

But IF any file in the folder it is unable to delete the folder.

How I will do that Please guide me.

Subject: How To Delete a Folder From HardDisk

First delete all the files the delete the folder.Otherewise take help from Animesh.

Subject: RE: How To Delete a Folder From HardDisk

Hi Aftab, Thx for the response. I ahve done the code.


Dim fileName As String

Dim pathName As String

Dim mpath As String

Dim mfile As String

pathName$ = "C:\try\*.*"

fileName$ = Dir$(pathName$, 0)

mfile = "C:\try"	

If  Dir$(pathName$,0)<>0 Then

	Print "The folder not found."

Else

	While fileName <> ""

		mfile = "C:\try\"	

		mfile = mfile & fileName

		Kill  mfile

		Print "The files has been deleted."

		fileName$ = Dir$()		

	Wend

	Rmdir "C:\try"

End If