Static News Archive

   (22-Nov-08 22:51)  Restarting wireless connection from Vista MC
My media pc runs Vista SP1, and most of the features work nicely.

One annoyance however is that when it wakes from sleep, the wireless adapter sometimes fails to connect properly. So to fix it, I usually have to close media center, and manually disconnect and reconnect the wireless from within windows.

As a more convenient workaround, and a chance to customize my vista media center menu, I decided to create a batch file to reconnect the wireless, and to add a menu item to vista.

The way it works is using Microsoft's programming API that allows you to launch any application you like by defining and registering a simple xml file.
Details of the format of the xml file can be found Here.

My xml file is as follows:

<application title="Reconnect Wireless" 
description="Restart the wireless connection" >
<capabilitiesRequired console="true"/>
run="C:\Program Files\Reconnectwireless\connectToWirelessNetwork.bat"
title="Reconnect Wireless"
imageUrl="C:\Program Files\Reconnectwireless\wirelessIcon.png">
<category category="Services\Movies"/>

I don't think the capabilities and Console=true part are actually requires, but it doesn't seem to hurt.
I used the first wireless png image that google turned up so that I see something nice in the menu :)

Next, the batch file which stops and start my wireless adapter:
@echo off
netsh wlan disconnect interface="Wireless Network Connection"
netsh wlan connect name="MySSID" ssid="MySSID"
interface="Wireless Network Connection"

Fnally, to register the xml file with vista, I just need to run the register application:
%windir%\ehome\RegisterMCEApp.exe InstallReconnectWireless.xml

And we are all done - I now have a reconnect wireless menu item in my media center main menu right next to My TV :)


Post a comment     

<-  (22-Sep-08 20:30)  An expensive investm... (9-Dec-08 16:50)  Javascript rounds lo...  ->