Fixing the Windows 7 Weather Gadget

Recently, my Windows 7 weather gadget started spontaneously saying that it “couldn’t connect to service”. This was odd, considering I’d configured this gadget years ago and hadn’t touched it since. If this is happening to you, here is how I fixed mine.

Apparently, the cause of the problem is that somehow my city name is changed from “Salt Lake City, UT” to “Salt Lake City, Utah”. I don’t know where this change is coming from or why the former works and the latter fails. However, I’ve come up with a quick .BAT file that you can use to correct the problem when it occurs.

The weather gadget gets its configuration from %LocalAppData%\Microsoft\Windows Sidebar\Settings.ini. In that file, you might see a couple lines like this:


The WeatherLocationCode and the WeatherLocation are used by the weather gadget to obtain and display the weather information. The code is used to do the search and the location text is used for display. I determined that this is the correct code for my city by searching for my city and observing that this code appears in the URL. I simply copy/pasted it from the URL.

If you google around for this problem, you will see people describing a fixup for the weather gadget that involves opening and saving, without modification, the file %LocalAppData\Microsoft\Windows Live\Services\Cache\Config.xml. I too found this necessary, but it can only be done when the gadget program, sidebar.exe is not running because it keeps this file open during execution. Taking all of this together, my solution is to:

  1. Stop the currently running sidebar.exe program.
  2. Copy the two above mentioned files from known good copies.
  3. Restart sidebar.exe

I do this with the following batch file:

taskkill /f /im sidebar.exe /t
cd "%LocalAppData%\Microsoft\Windows Sidebar"
copy MySettings.ini Settings.ini
cd "%LocalAppData%\Microsoft\Windows Live\Services\Cache"
copy MyConfig.xml Config.xml
start sidebar.exe

This solution assumes that you have saved off Settings.ini as MySettings.ini with known good data and simply made a copy of Config.xml as MyConfig.xml. (Remember, the Config.xml just needs to have its timestamp updated, the contents don’t need to be modified.)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: