Developing Matt

My Technical Journal

Process list at 2:30 am? no problem

leave a comment »

We were having a problem with a runaway process, and couldn’t determine which application it was coming from, so I write this little vbs script that creates a text file in c:\temp of all the current running processes.  Set up the scheduler for every 30 minutes, and the next day we found the culprit.  clever, eh?

dim filename
filename = “c:\temp\ProcessList” & day(date()) & “_” & hour(now()) & minute(now()) & “.txt”
dim wshShell
set wshshell = wscript.createobject(“wscript.shell”)
wshShell.run(“WMIC /OUTPUT:” & FILENAME & ” PROCESS get Caption,Commandline,Processid”)

Advertisements

Written by matt

June 19, 2007 at 9:24 am

Posted in vbscript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: