oracle - VBS Removing files within a directory using FileSystemObject with exceptions? -
i work rather finnicky oracle business intelligence software , have issues entail, clearing out specific data on users systems, , synchronizing server pull down data again. i've got vbs script i'm working on removes key directories, , renames others , stops services etc.
where i'm stuck on 1 specific directory. using filesystemobject, easiest way remove every single file within directory exception of single folder?
so, specific example, have c:\oraclebidata\sync\config
where want delete inside of "sync" directory, exception of config directory. takers?
snippet:
option explicit const folderspec = "c:\oraclebidata\sync" const excludefolder = "c:\oraclebidata\sync\config" deletesubfolders createobject("scripting.filesystemobject").getfolder(folderspec), excludefolder public sub deletesubfolders(byref myfolder, exclfolder) dim sf each sf in myfolder.subfolders if not (lcase(sf.path) = lcase(exclfolder)) deletesubfolders sf, exclfolder sf.delete end if next end sub
it not delete folders under excludefolder.
Comments
Post a Comment