Solved How to RUN A PROGRAM ONLY AFTER INTERNET IS CONNECTED?

gokulnc

New Member
Messages
23
Location
Chennai, India
I want my computer to automatically run a program (bat file) at startup only after my Internet connection is completely connected.
How do I do it?
 

My Computer

System One

  • OS
    Windows 8 Pro
    Computer type
    PC/Desktop
Use Task Scheduler, create a new task (that runs on log on of any user for example) and make the condition to start being on connection to the network you want.
 

Attachments

  • Capture.PNG
    Capture.PNG
    23.1 KB · Views: 59

My Computer

System One

  • OS
    Windows 10 Pro Prieview x64
    Computer type
    Laptop
    System Manufacturer/Model
    MacBook Pro Core2Duo
    CPU
    T7600
    Memory
    3
    Graphics Card(s)
    ATI Radeon X1600
    Monitor(s) Displays
    Internal
    Screen Resolution
    1440 x 800
    Hard Drives
    40GB
    Keyboard
    Apple
    Mouse
    Apple
    Internet Speed
    Varies
    Browser
    Various
    Antivirus
    Defender
Use Task Scheduler, create a new task (that runs on log on of any user for example) and make the condition to start being on connection to the network you want.

I've tried that, but that doesn't work for me. :(
It automatically runs the program when there is presence of network connection, not when it's completed connected. :)
 

My Computer

System One

  • OS
    Windows 8 Pro
    Computer type
    PC/Desktop
You could write a script to wait until you can ping google like the one below. You'll need change it to call your program and then save it as for example WaitScript.ps1

Then change your task scheduler entry to call this script. In task scheduler make it:

Program: powershell
Arguments: -executionpolicy bypass -file "C:\YourPath\WaitScript.ps1"

Code:
[FONT=Lucida Console][SIZE=1][COLOR=#006400][FONT=Lucida Console][SIZE=1][COLOR=#006400][FONT=Lucida Console][SIZE=1][COLOR=#006400]## Wait for Google[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
[FONT=Lucida Console][SIZE=1][COLOR=#00008b][FONT=Lucida Console][SIZE=1][COLOR=#00008b][FONT=Lucida Console][SIZE=1][COLOR=#00008b]do {
[FONT=Lucida Console][SIZE=1][COLOR=#0000ff]  Write-Host [/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#8b0000][FONT=Lucida Console][SIZE=1][COLOR=#8b0000][FONT=Lucida Console][SIZE=1][COLOR=#8b0000]"Waiting for Google..." [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#000080][FONT=Lucida Console][SIZE=1][COLOR=#000080][FONT=Lucida Console][SIZE=1][COLOR=#000080]-ForegroundColor [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#8b0000][FONT=Lucida Console][SIZE=1][COLOR=#8b0000][FONT=Lucida Console][SIZE=1][COLOR=#8b0000]"yellow"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
[FONT=Lucida Console][SIZE=1]} [FONT=Lucida Console][SIZE=1][COLOR=#00008b][FONT=Lucida Console][SIZE=1][COLOR=#00008b][FONT=Lucida Console][SIZE=1][COLOR=#00008b]until[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][FONT=Lucida Console][SIZE=1] ([/SIZE][/FONT][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#0000ff][FONT=Lucida Console][SIZE=1][COLOR=#0000ff][FONT=Lucida Console][SIZE=1][COLOR=#0000ff]Test-Connection [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#000080][FONT=Lucida Console][SIZE=1][COLOR=#000080][FONT=Lucida Console][SIZE=1][COLOR=#000080]-ComputerName [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#8a2be2][FONT=Lucida Console][SIZE=1][COLOR=#8a2be2][FONT=Lucida Console][SIZE=1][COLOR=#8a2be2][URL="http://www.google.com"]www.google.com[/URL] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#000080][FONT=Lucida Console][SIZE=1][COLOR=#000080][FONT=Lucida Console][SIZE=1][COLOR=#000080]-Quiet[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][FONT=Lucida Console][SIZE=1])
 [/SIZE][/FONT][/SIZE][/FONT]
[/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#006400][FONT=Lucida Console][SIZE=1][COLOR=#006400][FONT=Lucida Console][SIZE=1][COLOR=#006400]## Call your program
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Lucida Console][SIZE=1][COLOR=#0000ff][FONT=Lucida Console][SIZE=1][COLOR=#0000ff][FONT=Lucida Console][SIZE=1][COLOR=#0000ff]C:\windows\notepad.exe
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
 

My Computer

System One

  • OS
    Windows 10 Pro Prieview x64
    Computer type
    Laptop
    System Manufacturer/Model
    MacBook Pro Core2Duo
    CPU
    T7600
    Memory
    3
    Graphics Card(s)
    ATI Radeon X1600
    Monitor(s) Displays
    Internal
    Screen Resolution
    1440 x 800
    Hard Drives
    40GB
    Keyboard
    Apple
    Mouse
    Apple
    Internet Speed
    Varies
    Browser
    Various
    Antivirus
    Defender
Good news :)
 

My Computer

System One

  • OS
    Windows 10 Pro Prieview x64
    Computer type
    Laptop
    System Manufacturer/Model
    MacBook Pro Core2Duo
    CPU
    T7600
    Memory
    3
    Graphics Card(s)
    ATI Radeon X1600
    Monitor(s) Displays
    Internal
    Screen Resolution
    1440 x 800
    Hard Drives
    40GB
    Keyboard
    Apple
    Mouse
    Apple
    Internet Speed
    Varies
    Browser
    Various
    Antivirus
    Defender
Back
Top