{"id":75,"date":"2008-03-14T20:07:56","date_gmt":"2008-03-14T14:37:56","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/save-and-restore-desktop-icon-layout\/"},"modified":"2022-07-24T08:20:27","modified_gmt":"2022-07-24T02:50:27","slug":"save-and-restore-desktop-icon-layout","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/save-and-restore-desktop-icon-layout\/","title":{"rendered":"How to Save and Restore Desktop Icon Layout Automatically in Windows"},"content":{"rendered":"<p>When testing various display resolutions or after completing a remote desktop session, the desktop icons may go out of order. Another case is that when you accidentally use the Ctrl+ Scroll button (mouse) on your desktop, the Desktop icon size changes.\u00a0But reverting to the original icon size may not restore the custom icon positions on your desktop. You can quickly <a href=\"https:\/\/www.winhelponline.com\/blog\/undo-desktop-icons-auto-arrange-restart-explorer-exe\/\">undo the icon rearrangement<\/a> by terminating explorer.exe forcefully, but that works only in certain circumstances.<\/p>\n<p>In this article, we&#8217;ll see how to automatically save and restore desktop icons layout using different methods in Windows.<!--more--><\/p>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/fix-desktop-icons-layout-not-saved-restart\/\">Fix for Desktop Icons Layout Not Getting Saved Upon Restarting Windows<\/a><\/div>\n<h2>Save and Restore Desktop icon layout<\/h2>\n<h3>Option 1: Using the &#8220;DesktopOK&#8221; App<\/h3>\n<p>DesktopOK is a portable program from <code>www.softwareok.com<\/code> that runs on Windows 7 through Windows 10\/Windows 11. This program can save multiple configurations of your desktop icon layout and restore a specific setting when needed. There are separate downloads for 32-bit and 64-bit editions.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24186\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/03\/desktop-ok-save-icon-layout.png\" alt=\"desktop icon layout desktopok\" width=\"571\" height=\"323\" \/><\/p>\n<p>From the Options menu, you can enable these two settings:<\/p>\n<ul>\n<li>Save and restore icon spacing<\/li>\n<li>Save and restore icon size<\/li>\n<\/ul>\n<p>Click the Save button. The current screen resolution will be the name of the stored setting, followed by the date\/time stamp. You can change the naming style in Options if you want.<\/p>\n<p><em>(There is also a button named &#8220;Punch the icons (random position)&#8221; that scatters your desktop icons at random. After scattering you can use the Restore button to rearrange them from an earlier backup if you want to test.)<\/em><\/p>\n<p>By default, the saved desktop icon settings are stored in a file named <code>DesktopOK.ini<\/code> in the following location.<\/p>\n<pre>%AppData%\\DesktopOK<\/pre>\n<p>Alternatively, you can also export the desktop icon configuration to a .dok file via the DesktopOK menu option.<\/p>\n<p><em>There are additional settings available under the Options tab, like &#8220;auto-save&#8221; at pre-defined intervals and so on. Unlike other programs, DesktopOK is portable and doesn&#8217;t add a shell extension. DesktopOK may come in handy if Windows forgets your desktop icons position sometimes, or if explorer crashes and resets the desktop icons position to default.<\/em><\/p>\n<h4>DesktopOK Command-line Options:<\/h4>\n<pre><strong>Examples:<\/strong>\r\n\r\nSAVE TO FILE:\r\nDesktopOK.exe \/save \/silent c:\\icon_lay.dok\r\n(or)\r\nDesktopOK.exe \/save \"c:\\long path name\\icon_lay.dok\"\r\n\r\nLOAD FROM FILE:\r\nDesktopOK.exe \/load \/silent c:\\icon_lay.dok\r\n\r\n\/silent = don't show error messages\r\n\/spacing = save icon spacing\r\n\/size = save icon size\r\n\/report = Displays a list of unresolved\/found symbols in conjunction with \/load\r\nFor example: DesktopOK.exe \/load \/report c:\\icon_lay.dok\r\n\r\nInfo:\r\nThe file name must end with *.dok. The .dok file is a plain-text file.\r\n\r\nDate, time and resolution\r\n\/save c:\\save_dok\\_date_time_res_.dok\r\n\r\nor (Date and time)\r\n\/save c:\\save_dok\\_date_time_.dok\r\n<\/pre>\n<p><em><strong>Src:<\/strong> DesktopOK command-line documentation: <code>https:\/\/www.softwareok.com\/?seite=faq-DesktopOK&amp;faq=4<\/code><\/em><\/p>\n<h4>Automatically save desktop layout at every startup<\/h4>\n<p>To automatically save desktop icon layout at every startup:<\/p>\n<ol>\n<li>Create a shortcut with the following target:\n<pre>DesktopOK_x64.exe \/spacing \/size \/save \/silent \"D:\\Desktop Layout\\_date_time_.dok\"<\/pre>\n<\/li>\n<li><span style=\"font-size: inherit;\">Open the Startup folder of your user profile. To do so, run the <a href=\"https:\/\/www.winhelponline.com\/blog\/shell-commands-to-access-the-special-folders\/\">command<\/a>\u00a0<\/span><code style=\"font-size: inherit;\"><strong>shell:startup<\/strong><\/code><span style=\"font-size: inherit;\"> via the Run dialog.<\/span><\/li>\n<li><span style=\"font-size: inherit;\">Move the DesktopOK shortcut you created to the Startup folder.<\/span><\/li>\n<\/ol>\n<p>That&#8217;s it. The program should save the desktop layout at every startup.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26904\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/03\/desktop-layout-save-shortcut.png\" alt=\"desktop icon layout shortcut\" width=\"478\" height=\"164\" \/><\/p>\n<hr \/>\n<h3>Method 2: Using a VBScript<\/h3>\n<p>The following VBScript backs up the desktop layout registry settings to a <a href=\"https:\/\/www.winhelponline.com\/blog\/how-to-use-reg-files-registration-entries-windows\/\">.reg file<\/a>:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/winhelponline\/0356694d85a12ff5e8a260f2f5fea2ad.js\"><\/script><\/p>\n<p>The above script, when run, exports the following registry branch to a registry file. The name of the exported file will have the date and timestamp added to it.<\/p>\n<pre>HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\Shell\\Bags\\1\\Desktop<\/pre>\n<h4>Instructions<\/h4>\n<ol>\n<li>Download the <a href=\"https:\/\/gist.github.com\/winhelponline\/0356694d85a12ff5e8a260f2f5fea2ad\/raw\/12865660f8fb5a2ad61c56f97f1dfd1158c8ff2b\/savedesktoplayout.vbs\">above script<\/a> and save it to a permanent folder &#8212; e.g., <code>D:\\Scripts<\/code><\/li>\n<li>Create a shortcut to the script.<\/li>\n<li>Place the shortcut in your Startup folder.<br \/>\n<em>(Tip: To open your user profile&#8217;s Startup folder, run the command <strong>shell:startup<\/strong> via the Run dialog)<\/em><\/li>\n<\/ol>\n<p>The script will save the desktop icon layout to a registry file at every startup.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26905\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/03\/desktop-layout-save-script.png\" alt=\"desktop icon layout script\" width=\"659\" height=\"150\" \/><\/p>\n<p><strong>Note:<\/strong> During every run, the script will delete the desktop icon layout registry backups (in the specified folder) older than 3 days.<\/p>\n<h4>Customization<\/h4>\n<p>You can edit the script using Notepad and modify it as per your requirement:<\/p>\n<p>#1: To store the last 5 days&#8217; backup, set the <code>nMaxFileAge<\/code> variable (in Line <code>#16<\/code>) to <code>5<\/code>.<\/p>\n<pre>'Backups older than this (in days) will be deleted\r\nnMaxFileAge = 3<\/pre>\n<p>#2:\u00a0 To change the save directory, modify the following line in the script accordingly:<\/p>\n<pre>sSaveDir = \"D:\\Backup\\Shell Settings\\Desktop Layout\\\"<\/pre>\n<h4>Restoring desktop layout from an earlier .REG file<\/h4>\n<p>Restoring the desktop layout (from an earlier registry backup) has to be done only after terminating all instances of explorer.exe using Task Manager. From the Registry Editor (<code>regedit.exe<\/code>)&#8217;s File menu, click Import&#8230; and select the registry file you want to apply.<\/p>\n<p>Once done, start a fresh instance of <code>explorer.exe<\/code> using Task Manager.<\/p>\n<hr \/>\n<h3>Method 3: Using Layout.DLL (Windows 7 and Earlier)<\/h3>\n<p>Microsoft&#8217;s layout.dll shell extension (from the Microsoft Windows NT Resource Kit tools) can save and restore desktop icons&#8217; position on Windows 32-bit computers. The Layout.dll was originally written for Windows NT\/2000. It <strong>doesn&#8217;t work<\/strong> on Windows 64-bit versions.<\/p>\n<p>This extension works well under Windows 2000, and Windows XP through Windows 7 32-bit. I haven&#8217;t tested this on Windows 10 32-bit.<\/p>\n<h4>Installing the Layout.dll shell extension<\/h4>\n<ol>\n<li>To add the shell extension, download <a href=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived2\/layout.zip\">layout.zip<\/a> and save it to a folder.<\/li>\n<li>Unzip the archive and extract the files to your Desktop.<\/li>\n<li>Move <code>LAYOUT.DLL<\/code> to the <code>Windows\\System32<\/code> folder.<\/li>\n<li>Right-click <code>LAYOUT.REG<\/code> and choose Merge.<\/li>\n<li>Click Yes when asked for confirmation.<\/li>\n<\/ol>\n<p><strong>Note:<\/strong> Store the file layout.zip in a safe location if you need to uninstall the shell extension at a later time. You may use the file <code>uninstall.reg<\/code> (included in <code>layout.zip<\/code>) to remove the entries from right-click menu.<\/p>\n<h4>Saving and Restoring desktop icon layout<\/h4>\n<p>After installing the shell extension, you&#8217;ll see two context-menu options, namely <b>Save Desktop Icon Layout<\/b> and <b>Restore Desktop Icon Layout,<\/b> when you right-click on an empty area on the Desktop.<\/p>\n<p>When you click <strong>Save Desktop Icon Layout<\/strong>, the Desktop icon positions are saved to a binary registry value, and you see the following message box:<\/p>\n<figure style=\"width: 193px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived2\/layout-save.gif\" alt=\"\" width=\"203\" height=\"152\" \/><figcaption class=\"wp-caption-text\">Saving desktop icon layout<\/figcaption><\/figure>\n<figure style=\"width: 207px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived2\/layout-rest.gif\" alt=\"\" width=\"217\" height=\"152\" border=\"0\" \/><figcaption class=\"wp-caption-text\">Restore desktop icon layout<\/figcaption><\/figure>\n<h4>Uninstalling the Layout.dll shell extension<\/h4>\n<p>To uninstall the <code>layout.dll<\/code> shell extension, right-click the file <code>uninstall.reg<\/code> (available in layout.zip) and choose Merge. Then manually delete the file LAYOUT.DLL from your <code>Windows\\System32<\/code> folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When testing various display resolutions or after completing a remote desktop session, the desktop icons may go out of order. Another case is that when you accidentally use the Ctrl+ Scroll button (mouse) on your desktop, the Desktop icon size changes.\u00a0But reverting to the original icon size may not restore the custom icon positions on &#8230; <a title=\"How to Save and Restore Desktop Icon Layout Automatically in Windows\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/save-and-restore-desktop-icon-layout\/\" aria-label=\"Read more about How to Save and Restore Desktop Icon Layout Automatically in Windows\">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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6,7],"tags":[441,480],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-utilities","category-windows","tag-registry","tag-scripts"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3607,"url":"https:\/\/www.winhelponline.com\/blog\/undo-desktop-icons-auto-arrange-restart-explorer-exe\/","url_meta":{"origin":75,"position":0},"title":"How to Undo Desktop Icons Auto Arrange? [Quick Tip]","author":"Ramesh","date":"July 26, 2016","format":false,"excerpt":"If you've accidentally reset your custom desktop icons layout by enabling Auto-arrange or by hitting a wrong key sequence, here is a neat trick to revert back to the original position. Desktop icons layout remains in the memory until you initiate a logoff. During user account logoff or when restarting\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":984,"url":"https:\/\/www.winhelponline.com\/blog\/fix-desktop-icons-layout-not-saved-restart\/","url_meta":{"origin":75,"position":1},"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":1075,"url":"https:\/\/www.winhelponline.com\/blog\/fix-recycle-bin-icon-not-refresh-custom-icons-windows-7\/","url_meta":{"origin":75,"position":2},"title":"[Fix] Recycle Bin Icon Does Not Refresh Correctly","author":"Ramesh","date":"August 29, 2009","format":false,"excerpt":"When you use a custom icon (.ico) file to customize the Recycle Bin Empty & Full icons manually or via a desktop theme, the Recycle Bin icon may not update or refresh correctly when emptying the Recycle Bin or when you add items to it. In some cases, the issue\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"recycle bin does not refresh","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2009\/08\/w7-rbin-custicon-3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":26716,"url":"https:\/\/www.winhelponline.com\/blog\/duplicate-desktop-icons-in-windows\/","url_meta":{"origin":75,"position":3},"title":"Fix for Duplicate Desktop Icons in Windows","author":"Ramesh","date":"May 29, 2022","format":false,"excerpt":"Every time when you place a file or a shortcut on your Desktop, you may get 2 identical icons. If one icon is deleted, the other icon will also be removed if you refresh the Desktop. The path for both icons would be the same. You may be wondering what\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68028,"url":"https:\/\/www.winhelponline.com\/blog\/user-icon-looks-regular-folder-windows-11\/","url_meta":{"origin":75,"position":4},"title":"Windows 11 User icon looks like a Regular folder","author":"Ramesh","date":"December 16, 2023","format":false,"excerpt":"After adding the user profile icon to the desktop (via Settings > Personalization > Themes > Desktop icon settings), the user icon may look like a regular folder with the generic yellow folder icon. Users expect the icon to appear like the one below. Cause This happens if the desktop\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":"change user profile icon","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/12\/user-icon-custom.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":24029,"url":"https:\/\/www.winhelponline.com\/blog\/desktop-icons-spacing-messed-up-fix\/","url_meta":{"origin":75,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/75","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=75"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}