Hi!
How can I delete a folder with content. Is this in FW possible?
Thanks for your help.
Regards Aljoscha
Delete Folder with content
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
Hi Aljoscha,
The following code will completely delete cFolder and its all contents including subfolders from its parent.
Regards,
Ramesh Babu P
The following code will completely delete cFolder and its all contents including subfolders from its parent.
Code: Select all
WinExec("DELTREE "+cFolder,0)
Ramesh Babu P
Hi!
In the forum I have found a Function. Look:
RAMESHBABU thank you for your help
regards Aljoscha
In the forum I have found a Function. Look:
Code: Select all
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.
regards Aljoscha
Ramush,
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.
If needed, I can provide DELTREE.EXE.
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.
If needed, I can provide DELTREE.EXE.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- RAMESHBABU
- Posts: 591
- Joined: Fri Oct 21, 2005 5:54 am
- Location: Secunderabad (T.S), India
Hello Mr.Driessen,
Yes as you said, DELTREE.EXE is not provided in Windows NT, 2000, XP or Vista.
I am running both Win98 SE and XP in my system. Now after your above comment, I have copied DELTREE.EXE into my daughter's LAPTOP having VISTA (32 Bit) Home Premium and tested. It is working perfect.
My experience with DELTREE.EXE is that it is working OK in WIN95, WIN98, XP and even in VISTA and also Windows 2003 Server and 2000 also.
- Ramesh Babu P
Code: Select all
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.
I am running both Win98 SE and XP in my system. Now after your above comment, I have copied DELTREE.EXE into my daughter's LAPTOP having VISTA (32 Bit) Home Premium and tested. It is working perfect.
My experience with DELTREE.EXE is that it is working OK in WIN95, WIN98, XP and even in VISTA and also Windows 2003 Server and 2000 also.
- Ramesh Babu P