{"id":5592,"date":"2018-11-25T00:21:41","date_gmt":"2018-11-25T00:21:41","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=5592"},"modified":"2018-11-25T01:18:07","modified_gmt":"2018-11-25T01:18:07","slug":"beyond-good-ol-run-key-part-94","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2018\/11\/25\/beyond-good-ol-run-key-part-94\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 94"},"content":{"rendered":"<p>This is a short post to cover a &#8216;new feature&#8217; of Windows 10 that some users <a href=\"https:\/\/www.centbrowser.com\/forum\/showthread.php?tid=1933\">complain about online<\/a>.<\/p>\n<p>When you use this ugly system for a while, and at some time need to restart it, you may notice that sometimes applications that are running prior to restart are re-launched after you log on.<\/p>\n<p>A good example is Regedit. If you open it, restart the system, the application will be re-launched after the reboot.<\/p>\n<p>How does the Windows 10 know which processes to re-launch after the reboot?<\/p>\n<p>Prior to restart the system populates the RunOnce key adding a list of items in a form of:<\/p>\n<ul>\n<li>HKCU\\SOFTWARE\\Microsoft\\<br \/>\nWindows\\CurrentVersion\\<br \/>\nRunOnce\\Application Restart #N<br \/>\n=&lt;Application Path&gt;<\/li>\n<\/ul>\n<p>where N is a number (the code is inside the winsrvext.dll).<\/p>\n<p>So, if you come across entries like this, at least we can guess where they come from.<\/p>\n<p>Now, how does the OS actually know which programs to restart?<\/p>\n<p>If you ever used OSX you may be familiar with the a cool feature of re-opening currently opened applications after the reboot. Could that be that Windows 10 is following this path? Turns out that the truth is far more boring. This is actually not a Mac OSX-like feature at all. The OS simply grabs a list of programs that called the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/api\/winbase\/nf-winbase-registerapplicationrestart\">RegisterApplicationRestart<\/a> API during their run-time, and only these will be added to the RunOnce key.<\/p>\n<p>Last, but not least, I have no idea why Regedit calls this API at all&#8230;<\/p>\n<p>btw. I am getting old, I covered it in the past <a href=\"https:\/\/www.hexacorn.com\/blog\/2017\/05\/20\/using-registerapplicationrestart-as-a-lame-sandbox-evasion\/\">here<\/a>, although in a different context.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a short post to cover a &#8216;new feature&#8217; of Windows 10 that some users complain about online. When you use this ugly system for a while, and at some time need to restart it, you may notice that &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/11\/25\/beyond-good-ol-run-key-part-94\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,35],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5592"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=5592"}],"version-history":[{"count":8,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5592\/revisions"}],"predecessor-version":[{"id":5600,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5592\/revisions\/5600"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=5592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=5592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=5592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}