Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wildcard Filenames

Status
Not open for further replies.

sfriday

IS-IT--Management
Feb 23, 2002
211
DE
Newbie here.

I need to be able to locate filenames within a folder. I know the name of the folder and the first two chars of the filename, I also know the extension.

How can I achieve this

Dim ofs, oaf
set ofs = WScript.CreateObject("Scripting.FileSystemObject")
set oaf = ofs.GetFileName("C:\CSV\*.vbs")

however this fails as you can not use wildcards

HELP!!

Thanks
Steve
 
Dim ofs, oFiles, oaf
set ofs = WScript.CreateObject("Scripting.FileSystemObject")

set oFiles = ofs.GetFolder("C:\CSV").Files
For Each oaF in oFiles
if ....
Next
..add error handling for missing folder Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top