Is there a way to determine the 'uptime' of a process in Windows. Disappointed to find that it is not one of the attributes available when using the Task Manager.
7 Answers
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
- 433
- 4
- 8
-
I see values for most of the services but the one I want (w3wp) doesn't have a start time listed. – sirdank Jun 28 '19 at 15:26
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).
- 181
- 11
- 17,761
- 6
- 62
- 81
-
1
-
Or you can right click, Properties and on Threads tab, there is start time. – Betlista Aug 11 '17 at 08:49
-
In the link, Download section, "Run now from Sysinternals Live", when running, the `process tree` is not clickable in the view. I have windows 7 enterprise, so maybe it is blocked by my firewall. – Timo Jan 17 '18 at 13:37
-
-
1This answer is outdated. For Process Explorer v16.26, right click the process -> Properties -> Threads tab -> start time is listed below. No need to check `Show Process Tree` or `Show Lower Pane`. The `Performance` tab does not list start time any more. The lower pane isn't used to find the start time. – BurnsBA Jul 22 '19 at 13:14
If you're on a server where you cannot install any external tool, you still can :
- Open the task manager
- Click on the process tab
- Locate your process
- Right click on it
- 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.
- 135
- 5
-
1This only works on Windows 8. If you are still on Windows 7, the Properties option shows properties of the running executable file, not of the process. – Klitos Kyriacou Mar 12 '15 at 12:28
-
2
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.
- 21
- 2
Open Task Manager and right-click on the process. Choose Properties in the menu and look at the field Accessed in the first tab. Unless multiple instances have been started this will give you the start time of the process.
- 211
- 2
- 8
maybe you can try procxp http://technet.microsoft.com/en-us/sysinternals/bb896653
- 2,039
- 14
- 9
With the PID from Task Manager, you can use the following Powershell command with the implied -End (Get-Date):
New-Timespan -Start (Get-Process -Id PID).StartTime
- 1
- 1