Welcome to TechNet Blogs Sign in | Join | Help

Syndication

News

Locations of visitors to this page These postings are provided "AS IS" without warranty, and confer no rights.
Need an easy way to create a unique file name with the date?

 

I needed to dump winlogon and do some checks against the dump file and needed and easy way to get the computername and date in the file name and formatted so I could easily perfrom next steps.  Here was the soution:

C:\Debuggers>echo %computername%_%DATE:~10,4%.%DATE:~4,2%.%DATE:~7,2%
SK8ORDIE_2007.04.12

Here was the script I was running to do some checks and get a dump of winlogon...

c:\debuggers\tlist -v |findstr /c:" 0 " |findstr "winlogon.exe" > c:\tlist.txt

for /f "tokens=3" %%a in (c:\tlist.txt) do SET PID=%%a

echo %PID%

C:\debuggers\cdb -p %PID% -pvr -c ".dump /ma C:\debuggers\%computername%_%DATE:~10,4%.%DATE:~4,2%.%DATE:~7,2%_winlogon.dmp;qd" //Noninvasive attach to the process (pvr) gets userdump and quits.

del /f c:\tlist.txt

Published Thursday, April 12, 2007 8:46 PM by Brad Rutkowski

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
Page view tracker