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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -