Print Page | Close Window

Search for Files in UNC Path

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=29084
Printed Date: 28 March 2026 at 2:20pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Search for Files in UNC Path
Posted By: kennywhite
Subject: Search for Files in UNC Path
Date Posted: 26 January 2011 at 4:30pm
Hello,

We have two servers that store CVS files in multiple sub folders of a directory. I need to come up with a way to search for these files by name and allow the user to open the file. 

Can someone show me an example of how this can be done?

Thanks!!!



Replies:
Posted By: gotlivechat
Date Posted: 17 February 2011 at 1:22am
I'm assuming you mean CSV. What method did you want to use to 'search' for these files?

-------------
Adam Rasio
Live Chat Software Developer

http://www.GotLiveChat.com" rel="nofollow - www.GotLiveChat.com


Posted By: jamie.townsend
Date Posted: 18 February 2011 at 2:00pm
strDir = "c:\somefolder\"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objDir = FSO.GetFolder(strDir)
getInfo(objDir)

Sub getInfo(pCurrentDir)

For Each aItem In pCurrentDir.Files
   If LCase(Right(Cstr(aItem.Name), 3)) = "csv" Then
   
         ' file found, do something with it

   End If
Next


For Each aItem In pCurrentDir.SubFolders
   getInfo(aItem) 'passing recursively
Next

End Sub



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net