PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → New Command FDeleteAllFiles
New Command FDeleteAllFiles
Iniciado por BOLLER, mar., 05 2020 2:42 PM - Sem resposta
Membro registado
3.651 mensagems
Popularité : +175 (223 votes)
Publicado em março, 05 2020 - 2:42 PM
Segue abaixo o codigo fonte:

Procedure FDeleteAllFiles(Diretorio)

sDrive is string = fExtractPath(Diretorio,fDrive)
IF sDrive = "" THEN
sDrive = "c:"
END

sArquivoBat is string = [
cd\
@Drive@
cd @Diretorio@
cd..
rmdir /S /Q @Diretorio@
]

sArquivoBat = Replace(sArquivoBat,"@Drive@",sDrive)
sArquivoBat = Replace(sArquivoBat,"@Diretorio@",Diretorio)

sBatFile is string = fCurrentDir()+"deltree.bat"
fSaveText(sBatFile,sArquivoBat)

API("shell32.dll","ShellExecuteA",0, 0, &sBatFile,0, 0, 0)


Com muitos poderes... muitas responsabilidades!!!!

Cuidado onde vai usar, teste antes num ambiente que nao gere problemas.

OK

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/