Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Search for Files in UNC Path
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Search for Files in UNC Path

 Post Reply Post Reply
Author
kennywhite View Drop Down
Groupie
Groupie


Joined: 26 February 2009
Location: Indy
Status: Offline
Points: 106
Post Options Post Options   Thanks (0) Thanks(0)   Quote kennywhite Quote  Post ReplyReply Direct Link To This Post Topic: Search for Files in UNC Path
    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!!!
Back to Top
gotlivechat View Drop Down
Newbie
Newbie


Joined: 09 March 2010
Location: Upstate NY
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote gotlivechat Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.