Code:
StartFolder = "c:\spork"
CleanFolder(StartFolder)
Sub CleanFolder(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
extension = instr(f1.name, ".")
if extension = 0 then
if f1.name = "OracleEBS" then fs.deletefolder(StartFolder & "\" & f1.name)
else
if left(f1.name, extension-1) = "OracleEBS" then fs.deletefolder(StartFolder & "\" & f1.name)
end if
Next
End Sub
I just did this...tested and it worked. There's no msgbox's or acknowledgements of any kind but those can be added.
Basically you set the start folder path (your thininstall folder)
this loops through all the sub directories one by one.
first it checks to see it has a period in the folder name. if not, then it checks to see if it's named oracleEBS. if it is the folder is deleted.
if has a period in the folder name, then it looks at the characters BEFORE the period and if it matches OracleEBS the folder is deleted.
you could a a length check as well if you wanted to make sure that it only deletes oracleebs folders with a period in the name that are exactly 12 characters.....