{"id":10106,"date":"2025-08-17T00:08:34","date_gmt":"2025-08-17T00:08:34","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=10106"},"modified":"2025-08-17T00:08:34","modified_gmt":"2025-08-17T00:08:34","slug":"beyond-good-ol-run-key-part-150","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2025\/08\/17\/beyond-good-ol-run-key-part-150\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 150"},"content":{"rendered":"\n<p>I decided to add this post to this old series, but the scope of this post is &#8211; as you will find out soon &#8211; much wider.<\/p>\n\n\n\n<p>You will find <em>servercoreshell.exe<\/em> program to be present on both Windows Server 2022 and 2025. It is an interesting binary, because it does a lot of stuff that, well&#8230; makes it interesting! <\/p>\n\n\n\n<p>When you execute it, it displays the following screen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0.png\"><img decoding=\"async\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0-1024x577.png\" alt=\"\" class=\"wp-image-10107\" width=\"512\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0-1024x577.png 1024w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0-300x169.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0-768x433.png 768w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0-500x282.png 500w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_0.png 1115w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>I have not explored these options.<\/p>\n\n\n\n<p>Because&#8230; the far more interesting things happen under the hood. If you start Process Monitor before you execute <em>servercoreshell.exe<\/em> program and then look at the events collected during a single test session you will find out that some of them are&#8230; well.. interesting!<\/p>\n\n\n\n<p>It accesses a lot of interesting Registry locations, including:<\/p>\n\n\n\n<ul>\n<li><em>HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisableCurrentUserRunOnce<\/em><\/li>\n\n\n\n<li><em>HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce<\/em><\/li>\n\n\n\n<li><em>HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce<\/em><\/li>\n\n\n\n<li><em>HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx<\/em><\/li>\n\n\n\n<li><em>HKLM\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx<\/em><\/li>\n\n\n\n<li><em>HKLM\\SOFTWARE\\Microsoft\\ServerCore\\Shell Launcher\\Shell<\/em><\/li>\n\n\n\n<li><em>HKLM\\SOFTWARE\\Microsoft\\ServerCore\\Shell Launcher\\&lt;SID><\/em>\\Shell<\/li>\n\n\n\n<li>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ServerCore\\Shell Launcher\\Users\\Local\\&lt;user>\\Shell<\/li>\n\n\n\n<li>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ServerCore\\Shell Launcher\\Users\\Domain\\&lt;user>\\Shell<\/li>\n<\/ul>\n\n\n\n<p>And that <em>HKLM\\SOFTWARE\\Microsoft\\ServerCore\\Shell Launcher\\Shell<\/em> is a DEFAULT persistent location that allows me to put this post in the <em>Beyond good ol\u2019 Run key<\/em> series:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_1.png\" alt=\"\" class=\"wp-image-10108\" width=\"609\" height=\"166\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_1.png 609w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_1-300x82.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_1-500x136.png 500w\" sizes=\"(max-width: 609px) 100vw, 609px\" \/><\/a><\/figure>\n\n\n\n<p>For starters, we can modify the content of the file <em>c:\\WINDOWS\\System32\\servercoreshelllaunch.bat<\/em>. We can also change the value of the Registry entry that <em>shell<\/em> points to. Then the only remaining bit is to ensure the <em>servercoreshell.exe<\/em> program is executed at some time during system start, or after user logs in.<\/p>\n\n\n\n<p>Bad news though &#8212; need Trusted Installer rights for that.<\/p>\n\n\n\n<p>Still, this single program runs through many &#8216;shell&#8217; initialization routines that Windows Symbols describe as:<\/p>\n\n\n\n<ul>\n<li>ProcessHKLMRunOnce<\/li>\n\n\n\n<li>_RunStartupGroup<\/li>\n\n\n\n<li>ProcessPackagedStartupTasks<\/li>\n\n\n\n<li>ProcessRun6432<\/li>\n\n\n\n<li>LaunchCustomShellAndWait <\/li>\n<\/ul>\n\n\n\n<p>During my tests, I played around and pointed some of the aforementioned registry settings to calculator, notepad, etc. and I discovered that the <em>servercoreshell.exe<\/em> program often goes into a never-ending loop. When you launch it, then kill the main window, it will just continue to spawn its own copies. And when I set <em>shell<\/em> value to a randomly named user under <em>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ServerCore\\Shell Launcher\\Users\\Domain\\&lt;user>\\Shell<\/em> to calculator, I ended up with a never-ending loop of new Calculator instances being spawn:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_4.png\"><img decoding=\"async\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_4.png\" alt=\"\" class=\"wp-image-10111\" width=\"512\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_4.png 694w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_4-263x300.png 263w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><\/a><\/figure>\n\n\n\n<p>I suspect it&#8217;s a little buggy&#8230;<\/p>\n\n\n\n<p>I also believe the <em>servercoreshell.exe<\/em> program is related to this documented <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/configuration\/shell-launcher\/\">Shell Launcher<\/a> feature:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Shell Launcher is a Windows feature that you can use to replace the default Windows Explorer shell (Explorer.exe) with a Windows desktop application or a Universal Windows Platform (UWP) app. This feature is useful for creating a custom user experience on devices that are used for a specific purpose, including kiosks, ATMs, and digital signage.<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_2.png\"><img decoding=\"async\" loading=\"lazy\" width=\"415\" height=\"368\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_2.png\" alt=\"\" class=\"wp-image-10109\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_2.png 415w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_2-300x266.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_2-338x300.png 338w\" sizes=\"(max-width: 415px) 100vw, 415px\" \/><\/a><\/figure>\n\n\n\n<p>Installing the latter on Windows 11 introduces a slightly different executable to the system though: <em>ShellLauncherConfig.exe<\/em> and the <em>shell<\/em> keys it relies on are located in a different place too:<\/p>\n\n\n\n<ul>\n<li><em>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Embedded\\Shell Launcher<\/em><\/li>\n\n\n\n<li><em>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Embedded\\Shell Launcher cached<\/em><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_3.png\"><img decoding=\"async\" loading=\"lazy\" width=\"847\" height=\"187\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_3.png\" alt=\"\" class=\"wp-image-10110\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_3.png 847w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_3-300x66.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_3-768x170.png 768w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/08\/servercoreshell_3-500x110.png 500w\" sizes=\"(max-width: 847px) 100vw, 847px\" \/><\/a><\/figure>\n\n\n\n<p>Looks like the feature has at least 2 different, distinctive versions for server and non-server versions of Windows.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I decided to add this post to this old series, but the scope of this post is &#8211; as you will find out soon &#8211; much wider. You will find servercoreshell.exe program to be present on both Windows Server 2022 &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2025\/08\/17\/beyond-good-ol-run-key-part-150\/\">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":[35,64],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10106"}],"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=10106"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10106\/revisions"}],"predecessor-version":[{"id":10112,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10106\/revisions\/10112"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=10106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=10106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=10106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}