Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Wildcards in WSH
Message
 
 
To
24/07/2002 11:30:48
General information
Forum:
Windows
Category:
Other
Miscellaneous
Thread ID:
00682096
Message ID:
00683188
Views:
18
The FileSystemObject doesn't support wildcards. See INFO: Limitations of the FileSystemObject mskb #Q189751.

>I have a file that arrives on a regular basis with a name similar to
>
>24-JUL-2002.done
>
>I have to write a batch file that fires when the filename changes from my own
>done file.
>
>so
>
>24-JUL-2002.done arrives but my file is called 23-FEB-2002.done so some event must take place.
>
>My problem is that since the first part of the name keeps changing I can only access the files using wildcards ie *.done
>
>A program called IFSAME.EXE I used to use for this purpose no longer functions for some reason.
>
>It looks like the WSH could solve this problem but I dont know where WSH will allow me to use wildcards.
>
>modifying the code below to search for file names that end in .Done will probably do what I want but I have this nagging feeling I am missing something. Surely the file system object can handle wildcards.
>
>Dim filesys, demofolder, fil, filecoll, filist
>Set filesys = CreateObject("Scripting.FileSystemObject")
>Set demofolder = filesys.GetFolder("foldername")
>Set filecoll = demofolder.Files
>For Each fil in filecoll
> filist = filist & fil.name
> filist = filist & "
"
>Next
>Response.Write filist
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform