View Single Post
  #2 (permalink)  
Old April 13th, 2006, 11:51 AM
Raghunathan Raghunathan is offline
Authorized User
Join Date: Mar 2006
Location: Chennai, Tamil Nadu, India.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Raghunathan


here is the code u asked for. i hope it satisfies ur need.

================================================== ====
Dim objFSO, objFolder, objFiles, objFile
Dim strFolderPath

strFolderPath = "C:\MyFolder" 'Exact Path of the Folder

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strFolderPath)
Set objFiles = objFolder.Files

For Each objFile In objFiles
   Response.Write objFile.Path & "\" & objFile.Name

Set objFSO = Nothing
Set objFolder = Nothing
Set objFiles = Nothing

================================================== =

here you dont have to check for the existence of the file, as when u iterate thru the collection, it gets only the available files from the folder