Tagged with Script

Script – Limpar diretório Público

strPasta=”D:\Publica” set FSo = CreateObject(“Scripting.FileSystemObject”) Apagar_Arquivos(strPasta) Sub Apagar_Arquivos(Pasta) set folder = FSO.getFolder (Pasta) ‘Verifica se tem subpastas if folder.Subfolders.count > 0 then for each SubFolder in folder.Subfolders Apagar_Arquivos SubFolder next end if for each file in folder.files File.delete next if folder.Subfolders.count = 0 and folder.files.count=0 and Folder.Path<>strPasta then Folder.delete true end if end sub * … Continue lendo