How to trigger 'task scheduler' on new wifi connection?


  1. Posts : 2
    Windows 7 Ultimate x64
       #1

    How to trigger 'task scheduler' on new wifi connection?


    Hey everyone,

    Searched everywhere, and really striking out on how to do this (if it's even possible). I'd like to use Task Scheduler (or some other program) to automatically perform a task when my Android phone connects to my home wifi network (my PC is plugged into this router). Is there a way to use my Linksys router to trigger an event on my PC, that I can use to perform an action? Really just need it to do basic things, like start playing music on my computer by opening Spotify. Not sure if this is possible...

    Thanks in advance for the advice!
      My Computer


  2. Posts : 10,485
    W7 Pro SP1 64bit
       #2

    Welcome to the Seven Forums.

    One way to do this is to:
    ...have the Linksys router always assign the same IP address to your phone
    ...write/run a script* on your Windows computer that pings that IP
    ...once the IP responds then the phone is connected to that network
    ...the script can then launch or do whatever you can code it to do


    *use s scripting tool like AutoIt or AutoHotkey
      My Computer


  3. Posts : 2
    Windows 7 Ultimate x64
    Thread Starter
       #3

    UsernameIssues said:
    Welcome to the Seven Forums.

    One way to do this is to:
    ...have the Linksys router always assign the same IP address to your phone
    ...write/run a script* on your Windows computer that pings that IP
    ...once the IP responds then the phone is connected to that network
    ...the script can then launch or do whatever you can code it to do


    *use s scripting tool like AutoIt or AutoHotkey
    Thanks for the quick response. Looks like this task may be a little advanced for me (hardly any script writing experience...). I might have to keep searching for now.
      My Computer


  4. Posts : 10,485
    W7 Pro SP1 64bit
       #4

    Can you set your router to assign the same IP address to the phone?
    This is usually done via the mac address.

    Here is some AutoIt code that you can modify:
    Code:
    AutoItSetOption ("TrayIconDebug", 1)
    
    While 1
        If Ping("192.168.0.10", 10000) Then _Do_this()
        Sleep(1000)
    WEnd
    
    Func _Do_this()
        Run("notepad")
        While 1
            If Not Ping("192.168.0.1", 10000) Then Return
            Sleep(10000)
        WEnd
    EndFunc
    The first While/Wend loop waits for the phone to appear on the network.
    Once the phone shows up - the code goes to the function named _Do_this
    For this test code - I just have it open notepad.
    The next While/Wend loop waits for the phone to leave the network.
    Once the phone leaves - the code starts all over again at the first loop.

    Watch the second video in this post...
    SysTray Icons of some programs don't re-appear after Explorer restart
    ...and read the info about AutoIt.

    Give it a try - post back if you cannot get it to work.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:44.
Find Us