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.
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.
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).
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
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.
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
wmic process where ProcessID="<PID>" get CreationDate
You'll get a datetime like this:
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.
maybe you can try procxp http://technet.microsoft.com/en-us/sysinternals/bb896653