|
Post by angelo2449 on Dec 25, 2020 7:37:37 GMT -5
Merry Christmas guys,
I have a pronlema with the use of 'rmdir':
insert code here [M.Elimina.Soggetto]
#archivio.soggetti, "C:\CalcMill\Soggetti\" + trim$(Selected$)
confirm "Sei sicuro di voler eliminare il Soggetto : " + trim$(Selected$); Risp$
if Risp$ = "no" then
wait
else
result = rmdir("C:\CalcMill\Soggetti\" + trim$(Selected$))
if result <> 0 then
#archivio.soggetti, result
notice "Attenzione" + chr$(13) + "Il Soggetto : " + trim$(Selected$) + " NON è stato eliminato!"
else
notice "Info" + chr$(13) + "Il Soggetto : " + trim$(Selected$) + " è stato eliminato!"
end if
end if
wait
<span style="font-family: Verdana, Arial; font-size: 10pt;">insert code here
The folder 'C:\CalcMill \Soggetti$' + trim$ (Selected$) '
Exists but is not deleted.
I thank you all. </span>
|
|
|
Post by Rod on Dec 25, 2020 8:41:24 GMT -5
What error code is returned?
|
|
|
Post by tsh73 on Dec 25, 2020 8:53:57 GMT -5
for me, it returns 0 on deleting (everything OK) 145 if folder not empty 2 if folder not found 5 then I made folder read-only (it didn't get deleted)
|
|
|
Post by angelo2449 on Dec 25, 2020 13:33:40 GMT -5
145 The folder not empty
What should I do? Empty the folder? Thanks
|
|
|
Post by Chris Iverson on Dec 25, 2020 13:50:12 GMT -5
Yeah, all folders in the folder need to be deleted with rmdir() themselves, and all the files in the folder need to be deleted with KILL.
If there are folders in the folder, you'll also need to do the same to them recursively.
|
|
|
Post by angelo2449 on Dec 25, 2020 14:36:36 GMT -5
Many thanks Chris
|
|
|
Post by angelo2449 on Dec 30, 2020 0:55:51 GMT -5
The number of folders generated by the program is inconsistent, so I would have had to check all the contents to delete the main folder .. Too complicated! I thought he has this;
nomainwin open "D:\AltProvvisori\Varie\Cancella.bat" for output as #dos1 print #dos1, "@echo off" print #dos1, "rmdir " + "D:\AltProvvisori\Angelo /S/Q" close #dos1 run "D:\AltProvvisori\Varie\Cancella.bat"
end
It works perfectly, it deletes everything, folders, subfolders and contents.
|
|
|
Post by Rod on Dec 30, 2020 4:10:14 GMT -5
DOS were the days!
|
|