- bits & pieces about software development HostingAbc Logo
Show all posts.
These days I've bought a software, AllwaySync (http://allwaysync.com/) to easily synchronize my laptop's data to my central NAS device at home. It is a really handy piece of software but it is a big pain in the ass to allways manually start the synchronization - so I've figured out how to schedule a task in Windows Vista on the event of connection my laptop to a specific WiFi network.

So here are the rough steps you need to do. Start event viewer and go to the Microsoft-Windows-WLAN-AutoConfig/Operational log and check for the events with the ID 8001. These events are logged when the WiFi connection is up & running - and it contains all the information on the WiFi network. Here is how it looks like:
WLAN AutoConfig service has successfully connected to a wireless network.

Network Adapter: Intel(R) Wireless WiFi Link 4965AGN
Interface GUID: {40a3c36f-e20e-4875-b4be-db61787a5fe3}
Connection Mode: Connection to a secure network without a profile
Profile Name: ExternalDevices
SSID: ExternalDevices
BSS Type: Infrastructure
BSSID: 00:1C:57:43:14:11
PHY Type: 802.11g
Authentication: WPA-Personal
Encryption: TKIP
802.1x Enabled: No
Now the nice thing about the new event viewer is that it can give you an XML representation as well of this event:
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Microsoft-Windows-WLAN-AutoConfig"
 Guid="{9580d7dd-0379-4658-9870-d5be7d52d6de}" /> 
  <EventID>8001</EventID> 
  <Version>0</Version> 
  <Level>4</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8000000000000000</Keywords> 
  <TimeCreated SystemTime="2008-09-03T08:13:56.216Z" /> 
  <EventRecordID>6497</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="12" ThreadID="14812" /> 
  <Channel>Microsoft-Windows-WLAN-AutoConfig/Operational</Channel> 
  <Computer>sparky</Computer> 
  <Security UserID="S-1-5-18" /> 
  </System>
- <EventData>
  <Data Name="InterfaceGuid">{40A3C36F-E20E-4875-B4BE-DB61787A5FE3}</Data> 
  <Data Name="InterfaceDescription">Intel(R) Wireless WiFi Link 4965AGN</Data> 
  <Data Name="ConnectionMode">Connection to a secure network without a profile</Data> 
  <Data Name="ProfileName">ExternalDevices</Data> 
  <Data Name="SSID">ExternalDevices</Data> 
  <Data Name="BSSType">Infrastructure</Data> 
  <Data Name="BSSID">00:1C:57:43:14:11</Data> 
  <Data Name="PHYType">802.11g</Data> 
  <Data Name="AuthenticationAlgorithm">WPA-Personal</Data> 
  <Data Name="CipherAlgorithm">TKIP</Data> 
  <Data Name="OnexEnabled">0</Data> 
  <Data Name="ConnectionId">0xe</Data> 
  </EventData>
  </Event>


So you need to fire up Task Scheduler, create a new task, and in the triggers you should choose to run this task on a new event and use an XPath that matches the event that is logged. Here it is my version of the XPath that matches the event with ID 8001 and the Wifi network with the name: 'hostingabc.hu':
XML
1
2
3
4
5
6
7
8
9
<QueryList>
  <Query Id="0" 
Path="Microsoft-Windows-WLAN-AutoConfig/Operational">
    <Select Path="Microsoft-Windows-WLAN-AutoConfig/Operational">
		*{System\{(EventID=8001)}} and
 *{EventData{Data{@Name="SSID"}='hostingabc.hu'}}</Select>
  </Query>
</QueryList>

Note: I have a bug in my colorer and it does not handle the square bracket characters so I've replaced them with curly braces :) - just be sure you replace them to the proper square brackets.
Enjoy :).
add linkThe last comments:Afonso says:I'm trying to make a raid1 on the asus 500gp and I've saw your thread. But I cannot find the md.o and the raid1.o on modules.tar.gz file you attached. I also have a linux noobie question here should I put the files to make the insmod command see themmike says:Good videosmoszidev says:Venemo: it is at System.Web.Configuration.HttpConfigurationSystem.UseHttpConfigurationSystem moszidev says:dumb, ... no wonder your name is dumb :) ... i more or less expected these type of answers :) - trust me, i know the double locking design pattern :) ... but it seems that you don't really know for what the locking is needed ;) ...dumb says:this is called double locking: http://en.wikipedia.org/wiki/Double_checked_locking_patternVenemo says:Where did you find this in the framework?moszidev says:just found out that the maximum transfer rate on USB or UTP for this router is 3.5MBytes/sec. (that is 28MBit / sec)[br] So if you have a connection speed higher than this, it will not be fully used for sure.
Copyright (C) 2007, Molnar Szilveszter m@il me