Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - Creating scheduler rules to connect to the internet on boot /disconnect on reboot

Reply
 
Old 03-15-2007   #1 (permalink)
Richard Stallmann


 
 

Creating scheduler rules to connect to the internet on boot /disconnect on reboot

I tried to create a service to connect to the internet automatically on vista launch and disconnect on vista reboot, but all those
srvany.exe and sc.exe tools don't work properly any longer in Vista, or rather they don't work properly with rasphone.exe, because
MS hasn't updated that utility since 1995, just recompiled it to x64 bit. But this Task Scheduler 2.0 integrated in Vista is a great
thing, you can just define any rule and then define some task that will be executed if the defined event occurs. So I defined that
rasphone.exe -d ProviderName is started when the Lan-Connection is established and rasphone.exe -h (disconnect) is started when a
reboot occurs (I am using shutdown.exe to reboot). I created two rules and exported them, you can download them here:

To connect:

http://home.arcor.de/wrfan/files/vis...%20starten.xml

To disconnect:

http://home.arcor.de/wrfan/files/vis...%20beenden.xml

Don't just import the rules into scheduler, you have to adjust them to your configuration, these ones were created for the German
version of Vista and for a German ISP.

Open the event log in XML format ("System" hive) and copy the events in question into the trigger rules sections (beware the XML
syntax). The rules go like this:

<QueryList>
<Query Id="0" Path="System">
<Select Path="System">*[System[Provider[@Name='Tcpip'] and (EventID=4201)]] and *[EventData[(Data='LAN-Verbindung')]]</Select>
</Query>
</QueryList>

and:

<QueryList>
<Query Id="0" Path="System">
<Select Path="System">*[System[Provider[@Name='USER32'] and (EventID=1074)]] and
*[EventData[(Data='C:\Windows\System32\shutdown.exe (PHP)')]]</Select>
</Query>
</QueryList>

This is obviously just for cable modems, I am using a DSL connection

Don't define the start of RASMAN service as the trigger, it's not always detected on Vista startup, so the scheduler won't react.
Define the lan connection as the trigger, it's always in the event log



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
WMPlayer connect/disconnect Vista General
device connect/disconnect Vista General
Dual boot/internet won't connect Network & Sharing
Reboot to Connect to the Internet Vista networking & sharing
Vista Laptop reboot will not connect to internet Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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 35 36 37 38 39 40 41 42 43 44 45 46