Hello Experts,
I am having difficulty scripting ProcDump to actively monitor/attach to a process and when the process terminates, crashes, or hangs to take a Full Dump and finally continue to listen in a loop for the next instance of the processes' start for ProcDump to attach/monitor etc...
I would like for the dumps of the process (a service) to be limited to 4 dumps and overwrite the oldest dump file at each dump exceeding the 4th dump.
Below are the command line switches I am using
cd D:\ProcDump\
START ""/min "procdump" -e -h -t -ma "SomeProcess.exe" -accepteula SomeProcessDump.dmp"
http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx
Thank you,
Thanks,
@echo off
setlocal
set pd=D:\procdump.exe
set dest=D:\procdump\SomeProce
set wait=60
set keep=4
:_loop
set shortdatetime=%date:~10,4%
cd D:\ProcDump\
START ""/min "procdump" -e -h -ma -n 20 "SomeProcessDump*.dmp" -accepteula %dest%\SomeProcessDump.dmp
ping localhost -n %wait% > NUL 2>&1
ren "%dest%\SomeProcessService
set count=0
for /f "tokens=*" %%G in ('dir "%dest%\*SomeProcessServic
set oldest=%dest%\%%G
set /a count+=1
)
if %count% GTR %keep% del "%oldest%"
goto :_loop
if %count% GTR %keep% del "%oldest%"
goto :_loop