FoldersIn

Returns list of folders found in given folder in a string in ANStr format, similar to FilesIn, but this one is for folders
Can pass either mapped path or unmapped path, not both

Function FoldersIn(Path_MapPathed, Path_UnMapPathed, Sepa)
 Rett      = ""
 ServerFolder   = ""
 If Path_MapPathed > "" And Path_UnMapPathed = "" Then
  ServerFolder  = Path_MapPathed
 ElseIf Path_MapPathed = "" And Path_UnMapPathed > "" Then
  ServerFolder  = Server.MapPath(Path_UnMapPathed)
 End If
 If ServerFolder = "" Then Exit Function
 If Sepa = "" then Sepa = "|"
 dim fo,x
 ' Set fso      = CreateObject("Scripting.FileSystemObject")
 Set fo     = fso.GetFolder(ServerFolder)
 For each x in fo.subfolders
  If Rett > "" then Rett = Rett & Sepa
  Rett     = Rett & x.Name
 Next
 Set fo     = nothing
 FoldersIn    = Rett
End Function

Path_MapPathed, Path_UnMapPathed, Sepa

Views 448 Downloads 136

'FSO', 'FileSystemObject', 'FilesIn', 'Folders', 'FSO', 'FileSystemObject', 'subfolders', 'sub-folders', 'ANString', 'ANStr', 'ANStrList', 'mappath'

ANmarAmdeen
324
File System Classic ASP
Revisions

v2.0