Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Wildcards in WSH
Message
De
24/07/2002 11:30:48
 
 
À
Tous
Information générale
Forum:
Windows
Catégorie:
Autre
Titre:
Using Wildcards in WSH
Divers
Thread ID:
00682096
Message ID:
00682096
Vues:
55
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform