Page 1 of 1

Wmi - List all files

Posted: 2021-Jul-25, 9:17 am
by MigrationUser
10 Sep 2010 10:45
Teomangia


Hello everyone.
I would list all files in the Temporary Internet Files folder with WMI.

Code: Select all

Set colItemdir = objWMIService.ExecQuery("SELECT * FROM CIM_DataFile where path='\\Documents and Settings\\CurrentUser\\Impostazioni locali\\Temporary Internet Files\\')

For Each objItemdir in colItemdir
  wscript.echo objItemdir.filesize
Next
Works with all folders except the one set.

Why?

It 's a special folder?

Thanks

----------------------------

#2 10 Sep 2010 13:55
Teomangia


The files in the folder specified, are contained in subfolders. So my script was partially correct. I had to use a recursive query to happen and the individual subfolders.

original thread: https://ss64.org/oldforum/viewtopic.php?id=1091