Hi!
How can I delete a folder with content. Is this in FW possible?
Thanks for your help.
Regards Aljoscha
WinExec("DELTREE "+cFolder,0)
FUNCTION DELETEDIR( cDir )
LOCAL aDir, cName
LOCAL i
aDir = DIRECTORY( cDir + "\*.*", "HRD" )
FOR i = 1 TO LEN( aDir )
cName = aDir[ i, F_NAME ]
IF cName == "."; LOOP; ENDIF
IF cName == ".."; LOOP; ENDIF
cName = cDir + "\" + cName
IF "D" $ aDir[ i, F_ATTR ]
IF !DELETEDIR( cName )
RETURN .F.
ENDIF
ELSE
IF FERASE( cName ) = -1
? "Impossibile cancellare il file " + cName + "."
RETURN .F.
ENDIF
ENDIF
NEXT
//IF !LRMDIR( cDir )
// ? "Impossibile cancellare la cartella " + cDir + "."
// RETURN .F.
//ENDIF
RETURN .T.
DELTREE.EXE is a command of Windows 98 or 95. It doesn't exist in Windows NT, 2000, XP or Vista.
Altough if you can have a copy of the original DELTREE.EXE of Windows 98 or 95, it does work in NT, 2000, XP or Vista.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 93 guests