![]() |
|
|||||||
| ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum? |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
Im new at scripting VBscript and I have trouble with the script seen further down. What I want to do is store all the filenames that has the word "CSS" in them, but I cant get it to store in the array! Does anyone have any suggestions please? best regards Anders Dim FolderPath Dim objFSO Dim objFolder Dim colFiles Dim colFile Dim objFile Dim searchString Dim found Dim InstrReturn Dim array1 Dim i Dim j i = 0 searchString = "CSS" FolderPath = "D:\E-books\HTML, CSS, AJAX and Javascript Books 2007" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(FolderPath) Set colFiles = objFolder.Files For Each objFile in colFiles searchString = "CSS" found = objFile.Name InstrReturn = InStr(found, searchString) if InstrReturn <> 0 Then array1(i) =+ array(found) i = i + 1 end if Next For j = 0 to UBound (array1) Wscript.echo array1(j) Next |
|
This ad is part of our Revenue Sharing program |
![]() |
| Thread Tools | |
| Display Modes | |
|
|