Serving Time

Get the exact time that Windows processes via the WMIC command.

Bill: Is there a way to determine the start times of Windows processes? In
Task Manager under the Processes tab, fields such as "PID" and "CPU Time " can be displayed. However, these columns may not be an accurate
indication of the day or time that a process started. There are many circumstances when I'd like to know the start time of a process. In Unix, this information is available with the "ps -ef" command.
—Paul

If you're running Windows 2000 or higher, you can get this information quickly using the WMIC utility. Here's the syntax:

wmic path win32_process get caption,parentprocessid,
creationdate

Here's a sample listing:

Caption
CreationDate
ParentProcessId
smss.exe
20030714170032.498756-240
4
csrss.exe
20030714170034.701924-240
956
winlogon.exe
20030714170035.222673-240
956
services.exe
20030714170035.352860-240
1128
lsass.exe
20030714170035.362875-240
1128
svchost.exe
20030714170036.875049-240
1172
spoolsv.exe
20030714170037.175481-240
1172
explorer.exe
20030714170303.095304-240
676
wuauclt.exe
20030714170317.435924-240
1564
outlook.exe
20030714171041.644665-240
688
msimn.exe
20030714200523.016137-240
688
msmsgs.exe
20030714200523.977520-240
1368
iexplore.exe
20030714200659.725198-240
1368
cmd.exe
20030714202310.030428-240
688
sol.exe

20030714202311.432444-240

1332

The CreationDate format is YYYYMMDDHHMMSS with fractions of a second to the right of the decimal. In this example, it shows that I started playing Solitaire (sol.exe) at 8:23:11 on July 14, 2003.

Get Help from Bill

Got a Windows or Exchange question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to Bill at mailto:boswell@101com.com; the best questions get answered in this column.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message but submit the requested information for verification purposes.)

If you want to list the processes on a remote machine, you can specify the machine at the WMIC command line using the /node switch followed by the machine name in double quotes as follows:

wmic /node:"machinename" path win32_process get caption,creationdate,parentprocessid

Hope this helps!
—Bill Boswell

About the Author

Contributing Editor Bill Boswell, MCSE, is the principal of Bill Boswell Consulting, Inc. He's the author of Inside Windows Server 2003 and Learning Exchange Server 2003 both from Addison Wesley. Bill is also Redmond magazine's "Windows Insider" columnist and a speaker at MCP Magazine's TechMentor Conferences.

comments powered by Disqus

Reader Comments:

Fri, Jul 29, 2005 4u3u Anonymous

2all complaining: Actually you can retrieve any information from win2k using wmic... Remotely, of course - from XP or 2k3.

Fri, Mar 25, 2005 Manoel Brazil

Bill,I open the game that come with Windows, mine 98, the cards do not move.Is thereany file corrupted?
Tks
Manoel

Fri, Feb 27, 2004 Anonymous Anonymous

Use xp pro or any 2003 server to run wmic. You can specify your win2000(s) in node parameter
wmic /node:@c:\mywin2klist.txt path win32_process where name="sol.exe" get creationdate

Or terminae dam thing:
wmic /node:@c:\mywin2klist.txt path win32_process where name="sol.exe" cal terminate

Wed, Oct 1, 2003 Anonymous Anonymous

Thanks Bill.

Tue, Sep 30, 2003 Lee Anonymous

I would like to know about WMIC. I am running Windows XP Pro. I obviously did not get enough information from the column to be able to use this utility. What enviroment does this thing get run in? I tried to run it with no arguments, and got a message that something was installing it. I then looked for it as an installed program, and did not find it. I would request that you have someone who is uninformed read articles such as this, and try to do the stuff to test and see if the articles contain enough information to be of value. You can add me to the list of folk what gained nothing of worth by reading this article.

Wed, Sep 17, 2003 A UK

It is misleading, you can use wmic to get this information remotely from Win2k but only via WinXP or Win2003... ...it's a shame wmic is not available for Win2K and I see no technical reason why it shouldn't be - Win2K has a fully functional WMI architecture.

Thu, Jul 24, 2003 dennis portland

Well, it seems there's enough interest to porting wmic over to W2K! Will someone do that?

Thu, Jul 24, 2003 Anonymous Anonymous

It's nice to know about the utility, But he specifically said Win2k . It does no good in our environment since we don't use XP (yet). As it is its another bit of useless data for the moment. (hence why people are commenting)

Wed, Jul 23, 2003 Jonathan Shreveport, LA

Ok. So it's not available for 2k. Would anyone have know it was available for XP without Bill calling attention to it?? Good grief.

Wed, Jul 23, 2003 Anonymous Anonymous

I can not find anywhere where Microsoft provides WMIC for Windows 2000. They state in many places that WMIC is available on Windows XP and Windows Server 2003.

Wed, Jul 23, 2003 Rich Phoenix

MS KB Article 290216
Description of WMIC. Included with 2003 and XP only.

Wed, Jul 23, 2003 Don L Fairbanks,AK

Add me to the list of readers that call your attentionto the fact that the WMIC.exe utility is only avaialble in XP and the various versions of 2003 server. UNLESS you have a method for installing it on a W2k system - That I woud be interested in finding out about!

Wed, Jul 23, 2003 Ross Presser New Jersey

Just like everyone else commenting as well as everyone else on the net, WMIC is definitely !!NOT!! included with W2K; nor will it run on W2K if copied from a WXP machine. Ya goofed, Bill.

Wed, Jul 23, 2003 Kevin Buffalo

where do you find this wmic utility?

Wed, Jul 23, 2003 steve Anonymous

i can't seem to find it for 2k either ... everything i see on MSDN seems to indicate it is only for XP & 2003/.NET.

Wed, Jul 23, 2003 Keivn T. Fairbanks Stae of Nebraska-Lincoln

You indicate this works with Windows 2000, but I do not find the file on this OS. It is on Windows XP. Is there a way to install on Windows 2000?

Wed, Jul 23, 2003 Frank Barrett Iowa

Great to know! Thanks Bill.

Add Your Comment Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above

Redmond Tech Watch

Sign up for our newsletter.

I agree to this site's Privacy Policy.