Ian Boyd
2008-02-06 15:51:04 UTC
i'm trying to see what processes are reading or writing from what files and
how much on a non-Vista computer.
In the end i want a list that is of the form:
Image PID File Read (B/min) Write (B/min)
PDEngine.exe 4920 \Device\HarddiskVolume4 6358793 4911993
utorrent.exe 8056 S:\pagefile.sys (Page File) 4096 0
SearchIndexer.exe 1440
S:\SearchIndex\Search\Data\...\CiFiles\CiMG0027.001 0 69632
System 4 C:\Users\Ian\AppData\Roaming\uTorrent\resume.dat 0
120832
svchost.exe (LocalServiceNetworkRestricted) 1016
C:\Windows\ServiceProfiles\LocalService\AppData\Local\lastalive0.dat 0
512
System 4 C:\$Mft (NTFS Master File Table) 0 167366 Normal 0
System 4 S:\$LogFile (NTFS Volume Log) 0 192566 Normal 0
OUTLOOK.EXE 7924 C:\$LogFile (NTFS Volume Log) 0 106496
System 4 C:\$Mft (NTFS Master File Table) 0 12007 Normal 0
etc etc
Some among you will see which Microsoft app i've copied and pasted from -
which is why i'm trying to get something similar on XP. i asked in one
newgroup on how to get write such a thing, and one smart-ass suggested WMI.
So i thought i might as well ask: Can WMI get file I/O stats by process and
file? From what i can tell anything WMI can report you can also get through
perfmon.msc, and Performance Monitor cannot show file io bytes grouped by
process and file.
Basically i want:
SELECT
ProcessName,
ProcessID,
Filename,
SUM(BytesRead) AS FileRead,
SUM(BytesWritten) AS FileWrite,
FROM wmi.FileIoStatisticsByProcess
WHERE EventDate > getdate()-1/24/60 --one minute
GROUP BY ProcessName, ProcessID, Filename
how much on a non-Vista computer.
In the end i want a list that is of the form:
Image PID File Read (B/min) Write (B/min)
PDEngine.exe 4920 \Device\HarddiskVolume4 6358793 4911993
utorrent.exe 8056 S:\pagefile.sys (Page File) 4096 0
SearchIndexer.exe 1440
S:\SearchIndex\Search\Data\...\CiFiles\CiMG0027.001 0 69632
System 4 C:\Users\Ian\AppData\Roaming\uTorrent\resume.dat 0
120832
svchost.exe (LocalServiceNetworkRestricted) 1016
C:\Windows\ServiceProfiles\LocalService\AppData\Local\lastalive0.dat 0
512
System 4 C:\$Mft (NTFS Master File Table) 0 167366 Normal 0
System 4 S:\$LogFile (NTFS Volume Log) 0 192566 Normal 0
OUTLOOK.EXE 7924 C:\$LogFile (NTFS Volume Log) 0 106496
System 4 C:\$Mft (NTFS Master File Table) 0 12007 Normal 0
etc etc
Some among you will see which Microsoft app i've copied and pasted from -
which is why i'm trying to get something similar on XP. i asked in one
newgroup on how to get write such a thing, and one smart-ass suggested WMI.
So i thought i might as well ask: Can WMI get file I/O stats by process and
file? From what i can tell anything WMI can report you can also get through
perfmon.msc, and Performance Monitor cannot show file io bytes grouped by
process and file.
Basically i want:
SELECT
ProcessName,
ProcessID,
Filename,
SUM(BytesRead) AS FileRead,
SUM(BytesWritten) AS FileWrite,
FROM wmi.FileIoStatisticsByProcess
WHERE EventDate > getdate()-1/24/60 --one minute
GROUP BY ProcessName, ProcessID, Filename