Returns a list of all the files in the Scripts folder. If the computer has more than one scripts folder (for example, C:\Scripts and D:\Scripts), files will be returned from each of these folders. Just add what you want to happen when your conditions are met inside of the collection and each time your file pops up within the folder it will happen.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
Set colFiles = objWMIService. _
ExecQuery("Select * from CIM_DataFile where Path = '\\Scripts\\'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
Main Topics
Browse All Topics





by: ArkPosted on 2004-02-11 at 15:40:31ID: 10337484
Brief description with small sample: ilist/ Find FirstChang eNotificat ion.shtml /fileapi/w atchedfold er.htm on/_sample s/ Watch_Di rectory_De mo.zip
http://www.mentalis.org/ap
Complete sample and good description:
http://vbnet.mvps.org/code
Complete sample with some advanced extra functions:
http://www.mvps.org/vbvisi