{"id":3151,"date":"2016-05-29T20:55:46","date_gmt":"2016-05-29T15:25:46","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=3151"},"modified":"2020-11-06T10:17:46","modified_gmt":"2020-11-06T10:17:46","slug":"incorrect-uptime-taskmgr-wmi-refresh","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/incorrect-uptime-taskmgr-wmi-refresh\/","title":{"rendered":"Incorrect Uptime Reported by Task Manager and WMI. Refresh it Manually"},"content":{"rendered":"<p>Task Manager&#8217;s Performance tab (CPU section) shows the Uptime information of the system, but you may be wondering why your boot-up time doesn&#8217;t match the uptime data reported.<\/p>\n<p><!--more--><\/p>\n<p>This is because Task Manager or WMI wouldn&#8217;t deduct the duration of sleep\/hibernation when calculating uptime. And, with Fast Startup introduced and enabled by default in Windows 8 and Windows 10, the uptime reported may not correlate with your actual last boot-up time.<\/p>\n<p>Fast startup is a hybrid of cold startup + hibernate. When you shut down the computer with fast startup enabled, the user accounts are logged off completely. Then the system goes to hibernate mode (instead of traditional cold shutdown) so that the next boot up till the login screen will be quicker (30-70 % faster).<\/p>\n<div class=\"qt\">\n<h3>Different Ways to Find the System Uptime<\/h3>\n<p>There are some of the methods you can use to find the Uptime of your computer, all using WMI.<\/p>\n<h4>PowerShell<\/h4>\n<pre>[DateTime]::Now \u2013 [Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime))<\/pre>\n<p>Here is the <a href=\"https:\/\/blogs.msdn.microsoft.com\/powershell\/2009\/08\/12\/get-systemuptime-and-working-with-the-wmi-date-format\/\" target=\"_blank\" rel=\"noopener noreferrer\">Uptime<\/a> information.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime1.png\" width=\"307\" height=\"258\" border=\"0\" \/><\/p>\n<h4>SystemInfo<\/h4>\n<p>From a Command Prompt window, run:<\/p>\n<pre>systeminfo | find \/i \"Boot Time\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime2.png\" width=\"421\" height=\"131\" border=\"0\" \/><\/p>\n<h4>Net Statistics<\/h4>\n<p>From a Command Prompt window, run:<\/p>\n<pre>net statistics workstation<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime3.png\" width=\"350\" height=\"188\" border=\"0\" \/><\/p>\n<h4>WMIC (WMI&#8217;s Command-line Interface)<\/h4>\n<pre>wmic os get lastbootuptime<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime4.png\" width=\"351\" height=\"118\" border=\"0\" \/><\/p>\n<p>That&#8217;s in WMI time. But exactly means the same as 1 &amp; 2 above.<\/p>\n<p>Alternately, you can run this command-line:<\/p>\n<pre>wmic path Win32_PerfFormattedData_PerfOS_System get SystemUptime<\/pre>\n<p>The output will show the uptime of your computer in &#8220;Seconds.&#8221;<\/p>\n<h4>Microsoft Uptime.exe utility<\/h4>\n<p><a href=\"http:\/\/uptimeexe.codeplex.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Uptime<\/a> showed the same.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime5.png\" width=\"592\" height=\"97\" border=\"0\" \/><\/p>\n<h4>Task Manager<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/w10-uptime.png\" width=\"600\" height=\"651\" border=\"1\" \/><\/p>\n<\/div>\n<h2>Task Manager and WMI show incorrect uptime<\/h2>\n<p>Every method above showed the same uptime, varying only by a few seconds\/minutes, because of the time interval taken for taking screenshots for each item.<\/p>\n<p>But the fact is, the uptime is shown using every method also includes the hibernate time. The actual uptime should be 5 hrs, 55 minutes as of the time (<code>08:24 PM<\/code>) I&#8217;m writing this post. And you can verify that by checking shutdown and login events in Event Viewer.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime6-2.png\" width=\"600\" height=\"362\" border=\"1\" \/><\/p>\n<h3>Workaround 1: Shutdown without preparing for Fast Startup<\/h3>\n<p>Running the following command shuts down (cold shutdown) the system completely. But the benefits of fast startup won&#8217;t be available for the next boot.<\/p>\n<pre><b>shutdown \/s \/t 0<\/b><\/pre>\n<p>(or)<\/p>\n<p>Click Start, Power, and click <b>Restart<\/b> (instead of Shutdown)<\/p>\n<h3>Workaround 2: Disabling Fast Startup<\/h3>\n<p>If you want to disable fast startup, you can do so via Power Options.<\/p>\n<ol>\n<li>Open Control Panel, Power Options.<\/li>\n<li>Click Choose what the power buttons do<\/li>\n<li>Click Change settings that are currently unavailable<\/li>\n<li>Uncheck <b>Turn on fast startup (recommended)<\/b>, and click OK.<\/li>\n<\/ol>\n<h3>Workaround 3: Refresh the uptime Without Disabling Fast startup<\/h3>\n<ol>\n<li>Launch <code>Services.msc<\/code> and stop the Windows Management Instrumentation service.<\/li>\n<li>You&#8217;ll be prompted to stop the dependent services. Click Yes.<\/li>\n<li>Open the folder <code>C:\\Windows\\System32\\Wbem\\Repository<\/code><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime7.png\" width=\"411\" height=\"175\" border=\"1\" \/><\/li>\n<li>Delete all the files there.<\/li>\n<li>Restart Windows. Task Manager (or any of the above methods) should show the correct boot-up time now.<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/w10-uptime2.png\" width=\"600\" height=\"651\" border=\"1\" \/><\/li>\n<\/ol>\n<p>But the problem is that you need to clear the WMI repository at every shutdown, or else the uptime would continue to show the aggregated figure.<\/p>\n<h3>Workaround 3:\u00a0Create a Batch File and Run as a Shutdown Script (Windows Pro and higher)<\/h3>\n<p>You may create a Batch file with the following contents:<\/p>\n<div>\n<pre><code>net stop iphlpsvc &gt;d:\\wmireset.txt\r\nnet stop ncasvc &gt;&gt;d:\\wmireset.txt\r\nnet stop sharedaccess &gt;&gt;d:\\wmireset.txt\r\nnet stop wscsvc &gt;&gt;d:\\wmireset.txt\r\nnet stop winmgmt &gt;&gt;d:\\wmireset.txt\r\nsc query winmgmt &gt;&gt;d:\\wmireset.txt\r\nrd \/s \/q \"C:\\Windows\\System32\\wbem\\repository\" &gt;&gt;d:\\wmireset.txt\r\nmd \"C:\\Windows\\System32\\wbem\\repository\"\r\ndate \/t &gt;&gt;d:\\wmireset.txt\r\ntime \/t &gt;&gt;d:\\wmireset.txt<\/code><\/pre>\n<\/div>\n<p>That writes the batch file output along with the timestamp to a text file named wmireset.txt to know when was the batch file last run.<\/p>\n<p>Then open the Local Group Policy Editor (<code>gpedit.msc<\/code>) and go to:<\/p>\n<p>Computer Configuration \u2192 Scripts (Startup\/Shutdown)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/05\/uptime8.png\" width=\"544\" height=\"330\" border=\"0\" \/><\/p>\n<p>Add your batch file there and click OK.<\/p>\n<p>Restart Windows and check the uptime. Also, test if the uptime is refreshed in the subsequent restarts.<\/p>\n<p>Although I&#8217;ve not benchmarked the boot-up speed before clearing the WMI repository and after, it may delay your startup time as Windows has to rebuild the repository every time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Task Manager&#8217;s Performance tab (CPU section) shows the Uptime information of the system, but you may be wondering why your boot-up time doesn&#8217;t match the uptime data reported.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,10],"tags":[580],"class_list":["post-3151","post","type-post","status-publish","format-standard","hentry","category-windows-10","category-windows-8","tag-task-manager"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10415,"url":"https:\/\/www.winhelponline.com\/blog\/windows-logs-off-user-when-shutdown-or-hibernate\/","url_meta":{"origin":3151,"position":0},"title":"Windows Logs Off when Shutdown or Hibernate is used","author":"Ramesh","date":"July 20, 2019","format":false,"excerpt":"Over these years, at least since the Windows 7 era, we've seen several cases where the system logs you off when clicking on the Shutdown or Hibernate option in the Start menu. The problem may be seen in Windows 8, Windows 10, or 11 systems as well. What causes Windows\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"dumpfilters registry value","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/dumpfilters-registry.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/dumpfilters-registry.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/dumpfilters-registry.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":25233,"url":"https:\/\/www.winhelponline.com\/blog\/turn-on-fast-startup-missing-windows-11-10\/","url_meta":{"origin":3151,"position":1},"title":"&#8220;Turn on fast startup&#8221; option missing in Windows 11\/10","author":"Ramesh","date":"December 20, 2021","format":false,"excerpt":"Fast Startup is a feature in Windows 8\/10\/11 that speeds up the boot process significantly. With the Fast Startup feature enabled, when the user shuts down the computer, what happens under the hood is a hybrid shutdown sequence. However, on some computers, the Fast Startup and Hibernate features will be\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"fast startup option missing","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/12\/fast-startup-missing-power-options.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4868,"url":"https:\/\/www.winhelponline.com\/blog\/disable-hibernation-without-disabling-fast-startup\/","url_meta":{"origin":3151,"position":2},"title":"How to Disable Hibernation Without Disabling Fast Startup","author":"Ramesh","date":"December 18, 2016","format":false,"excerpt":"Fast Startup is a feature in Windows 8 and 10, which speeds up the boot process significantly. With the Fast Startup feature enabled by default, when the user shuts down the computer, what happens under the hood is a hybrid shutdown sequence. When a user issues the shutdown command, all\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"hybrid sleep disabled - reduced mode","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/hybrid-sleep-missing.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3971,"url":"https:\/\/www.winhelponline.com\/blog\/task-manager-startup-impact-calculated-bootckcl\/","url_meta":{"origin":3151,"position":3},"title":"What is Startup Impact in Task Manager and How is it Calculated?","author":"Ramesh","date":"September 2, 2016","format":false,"excerpt":"You would have noticed a column named \"Startup Impact\" in Task Manager's Startup tab in Windows 8 and higher. But what does \"Startup Impact\" mean and how is it assessed? Task Manager Startup tab lists all startup apps loading from Run, RunOnce registry keys and from the user's Startup folder,\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"task manager startup impact","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/taskmgr-startup-impact-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/taskmgr-startup-impact-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/taskmgr-startup-impact-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":23829,"url":"https:\/\/www.winhelponline.com\/blog\/move-hiberfil-sys-hibernation-another-drive\/","url_meta":{"origin":3151,"position":4},"title":"Can I move Hibernation file (hiberfil.sys) to another drive?","author":"Ramesh","date":"April 26, 2021","format":false,"excerpt":"When you hibernate your computer, the system dumps the entire memory contents to a file named hiberfil.sys in the system root folder. It's a hidden & system file whose default size is 40 percent of total physical memory (RAM) on a Windows 10 computer. The fast startup feature also uses\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"hibernation file move using regedit","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/04\/hiberfil-sys-registry-path-change.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/04\/hiberfil-sys-registry-path-change.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/04\/hiberfil-sys-registry-path-change.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/04\/hiberfil-sys-registry-path-change.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":69287,"url":"https:\/\/www.winhelponline.com\/blog\/hiberfile-type-not-support-hibernation\/","url_meta":{"origin":3151,"position":5},"title":"Powercfg: The hiberfile type does not support hibernation","author":"Ramesh","date":"January 4, 2024","format":false,"excerpt":"When you open the Power and sleep buttons and lid settings in Power Options, the Hibernate option may be missing from the dropdown. However, the \"Fast Startup\" option may be available. When you run Powercfg \/AVAILABLESLEEPSTATES or Powercfg \/A to report the sleep states available on the system, the output\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"power options - hibernate missing - dropdown","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/01\/hibernation-missing-power_options.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/01\/hibernation-missing-power_options.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/01\/hibernation-missing-power_options.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/01\/hibernation-missing-power_options.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/3151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=3151"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/3151\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=3151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=3151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=3151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}