Wmi - List all files

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Been thanked: 2 times
Contact:

Wmi - List all files

Post 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
Post Reply