******************************
Many we might need some part of code which'll access all sub-folders the the server and also all
The files within the sub-folder.
The following line of ASP code would map to a specified folder and searches all the sub-folders
(not recursively, code can is extended to does) and reads all files (basically-text files) one by one.
Can specify any folder name, in the remarks given in the code (within "")
' Create a File system Object
Set Filesystem=server. CreateObject ("Scripting.FileSystemObject")
Dim dbconn
Folderpath=server. MapPath ("Main Folder path")
Set Sfolder=filesystem.getfolder (FolderPath). Subfolders
For each folderitem in Sfolder
Set Files=folderitem.files
For each fileitem in Files
Fname=server. MapPath ("Main folder path" & Folderitem.name & "\" & Fileitem.name
Set File=filesystem.opentextfile (Fname,1,false)
While File.atendofstream <> True
Record=split (File.readline, "~")
Wend
File.close
Filesystem.deletefile (fname)
Next
Next
******************************