Page 1 of 1

Deleting A Folder (Not Empty)

Posted: Wed Jan 10, 2024 7:13 am
by Googie85
Hii Guys!!

I am trying to delete a directory that has files in it. I am able to delete the directory when there is no contents in the directory by using "folder delete". I have also tried:

put "rmdir " & quote & "d:\games\ac\content\cars\abarth500\Data\" & quote & " /s /q" into skippy
shell(skippy)

I have perused the dictionary for hours but no luck. Any replies are greatly welcomed!

Googie.

Edit: Is there a simple way to delete all the files in the selected directory?

Re: Deleting A Folder (Not Empty)

Posted: Wed Jan 10, 2024 7:59 am
by richmond62
I don't think that this is possible: after all that capability could be used a bit like a virus to delete vital files.

Re: Deleting A Folder (Not Empty)

Posted: Wed Jan 10, 2024 8:10 am
by Googie85
Thanks for your reply!!!

I could get a list of the files in the folder and do something like:

repeat until i = 170
put line i of folderVar into tester
delete file tester
add 1 to i
end repeat

I was just hoping for an easier way due to there being many folders to delete. I need to delete them without a large "delay" in processing the above code or something similar.

Many Thanks,

Googie.

Re: Deleting A Folder (Not Empty)

Posted: Thu Jan 11, 2024 12:06 am
by grzkmo
If a folder contains any files or folders, it cannot be deleted with the delete folder command until the items inside it are deleted or moved.


----> To delete a folder that is not empty, use the revDeleteFolder command.