G
Guest
My below script doesn't work as expected. No error message and nothing
happens. What can i do to fix this problem.?
I really want to list all files in current folder and its subfolders
thank you
============beginning===========
'This script lists all files in current folder and its subfolders
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery("ASSOCIATORS OF
{Win32_Directory.Name='c:\apache2'}" & " Where AssocClass =
Win32_Subdirectory ResultRole = PartComponent" & " ResultClass = CIM_DataFile
")
For Each objFile In FileList
wscript.echo(objFile.Name)
Next
=========ending==================
happens. What can i do to fix this problem.?
I really want to list all files in current folder and its subfolders
thank you
============beginning===========
'This script lists all files in current folder and its subfolders
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery("ASSOCIATORS OF
{Win32_Directory.Name='c:\apache2'}" & " Where AssocClass =
Win32_Subdirectory ResultRole = PartComponent" & " ResultClass = CIM_DataFile
")
For Each objFile In FileList
wscript.echo(objFile.Name)
Next
=========ending==================