Thanks guys,
Please refer to the commands in the batch file below:
Batch
=====
echo %Date% %TIME% & tasklist /fi "memusage gt 100000" >> c:\ym\tasklist.log
OUTPUT:
=======
Tue 10/09/2012 15:17:00.20
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
explorer.exe 476 Console 2 187,936 K
Maxthon.exe 8104 Console 2 275,520 K
OUTLOOK.EXE 5320 Console 2 190,076 K
Tue 10/09/2012 15:19:00.35
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
explorer.exe 476 Console 2 188,044 K
Maxthon.exe 8104 Console 2 300,520 K
OUTLOOK.EXE 5320 Console 2 190,080 K
The challenge for me is to bring the timestamp next to each process. Someone advise please. How can I just get the output in this format:
Time..............................................Imagename.....Memusage
Tue 10/09/2012 15:17:00.20......explorer.exe....189,384 K
Logging Memory usage and timestamp by Application
Moderator: DosItHelp
Re: Logging Memory usage and timestamp by Application
See how this goes.
Code: Select all
@echo off
for /f "skip=1 tokens=1,4,* delims=," %%a in (
'tasklist /fi "memusage gt 100000" /fo csv'
) do echo %date% %time% %%a %%c
pause
Re: Logging Memory usage and timestamp by Application
Foxidrive, you did it. Brilliant. Thanks alot it works as I expected.