{"id":4931,"date":"2016-12-31T23:20:08","date_gmt":"2016-12-31T17:50:08","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=4931"},"modified":"2019-05-12T02:52:47","modified_gmt":"2019-05-12T02:52:47","slug":"restart-explorer-gracefully-shortcut-command","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/restart-explorer-gracefully-shortcut-command\/","title":{"rendered":"How to Restart Explorer Cleanly Using Shortcut or Command-line"},"content":{"rendered":"<p>When you make changes to the Windows registry using the Registry Editor, script or any other automation tool, you may have to logoff and login back for the changes to take effect.<\/p>\n<p>That&#8217;s especially true if you&#8217;re altering the UI element metrics or changing the shell namespace folder icons etc. &#8212; as Explorer caches these settings when you log in.<!--more--><\/p>\n<p>And, some of the settings like desktop icons position and Taskbar preferences are written to the disk only at log off.<\/p>\n<p>Other than logging off and logging in back again, another way to immediately apply the changes is to exit Explorer using a hidden menu option which Microsoft added in Windows 7 and higher. And then start a new Explorer.exe instance using Task Manager. See <a href=\"https:\/\/www.winhelponline.com\/blog\/exit-explorer-restart-windows-10-8\/\">how to exit Explorer and restart it<\/a>, a graceful exit method.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5029\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/restart-explorer-gracefully.png\" alt=\"restart explorer gracefully\" width=\"675\" height=\"202\" \/><\/p>\n<p>A graceful restart of the Explorer shell means that the settings such as desktop icons layout, Taskbar preferences, etc. will be saved when Explorer exits. Whereas <a href=\"https:\/\/www.winhelponline.com\/blog\/undo-desktop-icons-auto-arrange-restart-explorer-exe\/\">forcibly terminating explorer.exe<\/a> processes using Task Manager (End Process), Taskkill.exe or Tskill.exe abruptly kill the Explorer shell without letting it complete its work.<\/p>\n<h2>Restart Explorer Cleanly using NirCmd shortcut<\/h2>\n<p>If you&#8217;ve been using the &#8220;Exit Explorer&#8221; hidden context menu option very often, then check out the NirCmd utility. The advantage of using NirCmd being, you can create a shortcut and assign a hotkey to it, and optionally add it to the context menu for quicker access.<\/p>\n<p>If you&#8217;re not already using <a href=\"http:\/\/www.nirsoft.net\/utils\/nircmd.html\" target=\"_blank\" rel=\"noopener noreferrer\">NirCmd<\/a>, an excellent automation tool from Nirsoft, download the portable application from the author&#8217;s site and extract NirCmd.exe to a folder.<\/p>\n<p>Create a shortcut with the following command-line, prefixing the drive-letter and folder path where NirCmd.exe resides. Customize the shortcut icon as desired:<\/p>\n<pre>nircmd.exe restartexplorer<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-4932\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/restart-explorer-nircmd-1.png\" alt=\"restart explorer gracefully\" width=\"100\" height=\"100\" \/><\/p>\n<p>Double-clicking the shortcut terminates Explorer in a recommended way &#8212; i.e., letting it save your settings and automatically exit when it&#8217;s done. It then waits for a couple of seconds and starts a new Explorer shell.<\/p>\n<h4>Add &#8220;Restart Explorer&#8221; to the right-click menu<\/h4>\n<p>You can add a &#8220;Restart Explorer&#8221; command to the right-click menu. Download <a href=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/restart-explorer-context-menu.zip\">restart-explorer-context-menu.zip<\/a>, unzip and run the enclosed REG file.<\/p>\n<p>Alternatively, to make the REG file of your own, copy the following lines to Notepad and save the file with a .REG extension. Double-click the file to run it.<\/p>\n<pre><code>Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CLASSES_ROOT\\DesktopBackground\\Shell\\Restart Explorer]\r\n\"icon\"=\"explorer.exe,0\"\r\n\"Position\"=\"top\"\r\n\"Extended\"=\"\"\r\n\r\n[HKEY_CLASSES_ROOT\\DesktopBackground\\Shell\\Restart Explorer\\command]\r\n@=\"nircmd.exe restartexplorer\"\r\n<\/code><\/pre>\n<p>The above registry setting assumes nircmd.exe is located in a folder which is included in the PATH, such as <code>Windows<\/code>, <code>Windows\\System32<\/code> etc. If not, add the complete path to Nircmd.exe accordingly in the REG file.<\/p>\n<p>Hold the <kbd>SHIFT<\/kbd> key down and right-click an empty area on the desktop. You&#8217;ll see the Restart Explorer command.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4933\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/restart-explorer-nircmd-2.png\" alt=\"restart explorer gracefully\" width=\"680\" height=\"334\" \/><\/p>\n<p><em>Want to make own &#8220;Exit Explorer&#8221; tool that doesn&#8217;t automatically restart Explorer? You can use the code sample at Stack Overflow. <a href=\"http:\/\/stackoverflow.com\/questions\/5689904\/gracefully-exit-explorer-programmatically\" target=\"_blank\" rel=\"noopener noreferrer\">Gracefully Exit Explorer (Programmatically)<\/a>. RestartManager API (Vista and up) may be a better option though.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you make changes to the Windows registry using the Registry Editor, script or any other automation tool, you may have to logoff and login back for the changes to take effect. That&#8217;s especially true if you&#8217;re altering the UI element metrics or changing the shell namespace folder icons etc. &#8212; as Explorer caches these &#8230; <a title=\"How to Restart Explorer Cleanly Using Shortcut or Command-line\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/restart-explorer-gracefully-shortcut-command\/\" aria-label=\"Read more about How to Restart Explorer Cleanly Using Shortcut or Command-line\">Read more<\/a><\/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":[7],"tags":[335],"class_list":["post-4931","post","type-post","status-publish","format-standard","hentry","category-windows","tag-nircmd"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":984,"url":"https:\/\/www.winhelponline.com\/blog\/fix-desktop-icons-layout-not-saved-restart\/","url_meta":{"origin":4931,"position":0},"title":"Fix for Desktop Icons Layout Not Getting Saved Upon Restarting Windows","author":"Ramesh","date":"January 24, 2010","format":false,"excerpt":"Windows saves the desktop icon layout when the user logs off, and the setting is read during logon. Recently I came across a case where the desktop icons rearrange to their default positions after a restart or logoff\/login cycle. This turned out to be a Permissions issue with a registry\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"exit explorer windows 10","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2010\/01\/exit-expl-w10.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3355,"url":"https:\/\/www.winhelponline.com\/blog\/desktop-icons-tiles-view-mode-fix\/","url_meta":{"origin":4931,"position":1},"title":"Desktop looks like a regular folder or Changes to Tiles view mode","author":"Ramesh","date":"August 1, 2016","format":false,"excerpt":"If your Desktop has suddenly changed to \"Tiles\" view mode on your Windows computer, you may have accidentally hit a shortcut key that switches the folder view mode. It's also possible that the FFlags registry value data is incorrect. This article tells you how to restore the Desktop's default view\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":"desktop folder view changed fflags","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/desktop-appear-normal-folder-fflags.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/desktop-appear-normal-folder-fflags.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/desktop-appear-normal-folder-fflags.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/desktop-appear-normal-folder-fflags.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/desktop-appear-normal-folder-fflags.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/desktop-appear-normal-folder-fflags.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":25702,"url":"https:\/\/www.winhelponline.com\/blog\/get-back-windows-10-ribbon-ui-windows-11\/","url_meta":{"origin":4931,"position":2},"title":"Get Back Windows 10 Ribbon UI in Windows 11 File Explorer","author":"Ramesh","date":"January 15, 2022","format":false,"excerpt":"The File Explorer in Windows 11 has a new\/modern ribbon interface with small icons (no caption text underneath). The new ribbon interface may look bland and uncomfortable for new users who have upgraded to Windows 11 from Windows 10 or earlier. Luckily, there are many different ways to get back\u2026","rel":"","context":"In &quot;Windows 11&quot;","block_context":{"text":"Windows 11","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-11\/"},"img":{"alt_text":"get ribbon script winlogon shell","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/01\/winlogon-replace-ribbon-script.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1121,"url":"https:\/\/www.winhelponline.com\/blog\/reset-folder-views-bags-windows\/","url_meta":{"origin":4931,"position":3},"title":"How to Reset Folder View Settings in Windows 10\/11 and Earlier","author":"Ramesh","date":"February 28, 2011","format":false,"excerpt":"Folder view settings include column preferences, view mode (icon or thumbnail), grouping, sorting order, window size, etc. Sometimes Windows may forget your folder view settings due to corruption or if the 5000 folders limit has been reached. For instance, Windows may keep resetting the view back to \"List\" even though\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"folder view bags","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/02\/fviews.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/02\/fviews.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/02\/fviews.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":24029,"url":"https:\/\/www.winhelponline.com\/blog\/desktop-icons-spacing-messed-up-fix\/","url_meta":{"origin":4931,"position":4},"title":"[Fix] Desktop Icons Spacing is Messed Up in Windows","author":"Ramesh","date":"May 11, 2021","format":false,"excerpt":"Occasionally, your desktop icons may be spaced out too far or very close to each other in Windows. The desktop icon spacing may sometimes be messed up after installing a video driver update. In some cases, the vertical spacing may be fine, but the horizontal spacing may be messed up\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"desktop icon spacing incorrect","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/desktop-icons-widely-spaced.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/desktop-icons-widely-spaced.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/desktop-icons-widely-spaced.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":970,"url":"https:\/\/www.winhelponline.com\/blog\/clear-customize-notifications-tray-items-windows\/","url_meta":{"origin":4931,"position":5},"title":"How to Clear Customize Notifications (Taskbar Corner Overflow) Icons","author":"Ramesh","date":"February 13, 2007","format":false,"excerpt":"Over time, many invalid or obsolete taskbar notification icons may appear on the \"Customize notifications\" or the \"Select which icons appear on the Taskbar\" page with duplicate, invalid or missing icons. On Windows 11, the setting is called \"Taskbar corner overflow.\" It's located under Personalization \u2192 Taskbar, in the Settings\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"taskbar tray overflow remove single entry","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/02\/tray-overflow-icon-remove-single-entry-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/02\/tray-overflow-icon-remove-single-entry-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/02\/tray-overflow-icon-remove-single-entry-3.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/4931","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=4931"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/4931\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=4931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=4931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=4931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}