{"id":75,"date":"2015-03-04T21:09:14","date_gmt":"2015-03-04T21:09:14","guid":{"rendered":"https:\/\/wp.local\/?p=75"},"modified":"2015-03-06T01:00:45","modified_gmt":"2015-03-06T01:00:45","slug":"problems-with-windows-gadgets","status":"publish","type":"post","link":"https:\/\/blog.c-devtech.net\/?p=75","title":{"rendered":"Problems with Windows Gadgets"},"content":{"rendered":"<p>First, I would like to state that I know <a title=\"Microsoft\" href=\"http:\/\/windows.microsoft.com\/en-us\/windows\/gadgets\" target=\"_blank\">Microsoft<\/a> has said gadgets are a bad idea and that there are better alternatives out there. But I do development under Windows 7 and there are a few gadgets that I use everyday and like. For example, the weather gadget and the analog clock with the second hand.<\/p>\n<p>So that being said, it seemed that every couple of days the gadgets wouldn&#8217;t start. Initially I tried to fix it with a Reset_Gadgets batch file as presented by <a title=\"Shawn Brink\" href=\"http:\/\/www.sevenforums.com\/tutorials\/140358-gadgets-not-displaying-correctly-windows-7-fix.html\" target=\"_blank\">Shawn Brink<\/a>. This worked fine but I wanted to automate the fix so I checked what actually was needed. After some experimentation, it seemed that only killing and restarting the sidebar.exe application was necessary for the gadgets to reappear.<\/p>\n<p>Looking around I found a post by <a title=\"garycase\" href=\"http:\/\/www.sevenforums.com\/gadgets\/287083-gadgets-not-loading-all-boot-3.html\" target=\"_blank\">garycase<\/a> which mentions the problem as being the system booting &#8216;too fast&#8217; and provides a &#8216;GadgetsFix.cmd&#8217; to solve the problem. After removing the gadget&#8217;s auto-start registry key:<\/p>\n<p><em> [HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run] &#8220;Sidebar&#8221;=&#8221;C:\\\\Program Files\\\\Windows Sidebar\\\\sidebar.exe \/autoRun&#8221;<\/em><\/p>\n<p>I put &#8216;GadgetsFix.cmd&#8217; in the start-up folder <em>C:\\Users\\xxx\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup<\/em> and while there was the occasional blinking of the gadgets on start-up they always seemed to appear. However, now I would get a<em> Service not available<\/em> error from the weather gadget every few days.<\/p>\n<p>According to <a href=\"http:\/\/answers.microsoft.com\/en-us\/windows\/forum\/windows_vista-desktop\/windows-sidebar-gadgets-will-open-but-gadget\/eb91b3a8-972f-46ef-9437-3e48245c3e35\" target=\"_blank\">Aaron &#8211; G<\/a>, the problem was fixed by deleting the <em>settings.ini <\/em>file or by doing just about everything <a title=\"Shawn Brink\" href=\"http:\/\/www.sevenforums.com\/tutorials\/140358-gadgets-not-displaying-correctly-windows-7-fix.html\" target=\"_blank\">Shawn Brink<\/a> was doing in his batch file. So while going back to the Reset_Gadgets batch file was certainly an option, I looked more into the <em>settings.ini<\/em> angle and what I found was that if the <em>config.xml<\/em> file was <a title=\"Gadget Fix\" href=\"http:\/\/www.sevenforums.com\/software\/360496-weather-widget-replacement-windows-7-a-4.html\" target=\"_blank\">saved without making any changes<\/a>, the gadget services could connect again. Well, this sounded like the <em>config.xml <\/em>just needed to be &#8216;touched&#8217; for it to work so I found a little dos command that performs a &#8216;touch&#8217;<\/p>\n<p><em>COPY \/B %1+,, %1<\/em><\/p>\n<p>and put it into a batch file. I then edited the batch file &#8216;GadgetsFix.cmd&#8217; by <a title=\"garycase\" href=\"http:\/\/www.sevenforums.com\/gadgets\/287083-gadgets-not-loading-all-boot-3.html\" target=\"_blank\">garycase<\/a> to include the touch.cmd file and everything seems to work pretty consistently. Here is my edited &#8216;GadgetsFix.cmd&#8217;<\/p>\n<blockquote><p>@echo off<br \/>\ntimeout 2<br \/>\ntasklist \/FI &#8220;IMAGENAME eq sidebar.exe&#8221; 2&gt;NUL | find \/I \/N &#8220;sidebar.exe&#8221;&gt;NUL<br \/>\nIF &#8220;%ERRORLEVEL%&#8221;==&#8221;0&#8221; (<br \/>\ntaskkill \/f \/im:sidebar.exe<br \/>\n) else (<br \/>\ncall touch &#8220;C:\\Users\\xxx\\AppData\\Local\\Microsoft\\Windows Live\\Services\\Cache\\Config.xml&#8221;<br \/>\nstart &#8220;&#8221; &#8220;%ProgramFiles%\\Windows Sidebar\\sidebar.exe&#8221;<br \/>\n)<\/p>\n<p>timeout 1<br \/>\ntasklist \/FI &#8220;IMAGENAME eq sidebar.exe&#8221; 2&gt;NUL | find \/I \/N &#8220;sidebar.exe&#8221;&gt;NUL<br \/>\nIF &#8220;%ERRORLEVEL%&#8221;==&#8221;0&#8221; (<br \/>\ntaskkill \/f \/im:sidebar.exe<br \/>\n)<br \/>\nelse (<br \/>\ncall touch &#8220;C:\\Users\\xxx\\AppData\\Local\\Microsoft\\Windows Live\\Services\\Cache\\Config.xml&#8221;<br \/>\nstart &#8220;&#8221; &#8220;%ProgramFiles%\\Windows Sidebar\\sidebar.exe&#8221;<br \/>\n)<\/p>\n<p>exit<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>First, I would like to state that I know Microsoft has said gadgets are a bad idea and that there are better alternatives out there. But I do development under Windows 7 and there are a few gadgets that I &hellip; <a href=\"https:\/\/blog.c-devtech.net\/?p=75\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","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_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-windows-7-development"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1IEK3-1d","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":6,"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.c-devtech.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}