简体   繁体   中英

VBScript Wildcard equivalent to T-SQL “%”

I'm trying to basically to see if a file exists that has the current date in its filename. In T-SQL when I want to search for something within a string, I just enclose it in "%" characters like this: %June 14 2012%

How do I do something like that in VBScript?

由于要查找文件,请使用“ *”。

Try something like:

Folder = "C:\" 

Set fso = CreateObject("Scripting.FileSystemObject") 
Set fold = fso.GetFolder(folder) 
For Each file in fold.Files 
    If Instr(file, "June") >0 Then
        Response.Write file.name & " got it in filename!"
    End if 
Next 
Set fold = Nothing
Set fso = Nothing 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM