scripting wmi vbscript

WMI VBScript to rename files

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'")

Subscribe to RSS - scripting wmi vbscript