Submitted by northben on Thu, 04/16/2009 - 15:21
I needed to watch a directory for incoming files, then rename the files sequentially and move them. Here's how I did it.
int i
for i = 1 to 10000
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery("Select * From CIM_DataFile Where Path = '\\scripts\\' and Extension = 'pdf'")