Determine process uptime

Solution 1:

This can be done using Powershell.

Run it as admin and then execute

Get-Process | select name, starttime

You will get a list of all running processes and their start times

Referenced from: http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/18/powertip-use-powershell-to-easily-see-process-start-time.aspx

Solution 2:

You can see this with Process Explorer. In the taskbar menu select View and check Show Process Tree and the Show Lower Pane options. Right click on any column and Select Columns, now click on the Process Performance tab and check the Start Time box.

Community Update:

As mentioned in the comments, in more recent versions of the tool (currently as of 2019), the information has been relocated into the image tab of the property sheets regarding each process-tree item (Just double-click the process name, no other steps are required).

enter image description here


Solution 3:

If you're on a server where you cannot install any external tool, you still can :

  1. Open the task manager
  2. Click on the process tab
  3. Locate your process
  4. Right click on it
  5. Select the Properties option

You can see a "creation date" right there, which should be the creation date of your process. With a simple substraction you can deduce the uptime.


Solution 4:

In CMD you can use standard Windows Management Instrumentation Command-line (WMIC) utility to get the process start time:

wmic process where Name="<process name>" get CreationDate

or

wmic process where ProcessID="<PID>" get CreationDate

You'll get a datetime like this: 20201021010512.852810+180.
Format: YYYYMMDDHHMMSS.ssssss+MMM(UTC offset)

If you want a more readable representation you'd need to prep it with a script. Here I have written a little batch script for the purpose:

@ECHO OFF
SETLOCAL

IF [%1]==[] (
    ECHO Prints process creation date in ISO format. 
    ECHO:
    ECHO USAGE: %~n0 ^<PID or Process name^>
    EXIT /B 1
)

IF [%~x1]==[.exe] (SET type=Name) ELSE (SET type=ProcessID)

FOR /F "tokens=1,2 delims==" %%a IN ('wmic process where %type%^="%~1" get CreationDate /value') DO (
    IF [%%a]==[CreationDate] SET proc_cd=%%b
)

IF DEFINED proc_cd (
    ECHO %proc_cd:~0,4%-%proc_cd:~4,2%-%proc_cd:~6,2%T%proc_cd:~8,2%:%proc_cd:~10,2%:%proc_cd:~12,2%
)

Feed it with a PID or a process name ending with .exe and it will output when the process was started. Caveat: If there are many processes with the same name it would output the time only for the last one started.