I would like to create an event based scheduled task in Windows 7 that starts a program (VirtualRouter) when a specific network connection via LAN is established. I tried use a Windows/NetworkProfile 10000 trigger, but it makes a loop because VirtualRouter creates it's own network connection.
Since you said using a script is ok, the easiest way to accomplish this is probably a simple one liner in Powershell like this example:
if (! (ps | ? {$_.Path -eq "C:\Windows\system32\notepad.exe"})) {& "C:\Windows\system32\notepad.exe"}
This would just Launch your program whenever it is not already running. If you trigger this with the 10000 event on network connection every time it will still only start your program once.
I chose Powershell because it is included in windows and it's a nice one liner, so if you are more experienced in another scripting language the same principle:
can of course be implemented in any language.