Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:02:00+00:00 2026-05-23T09:02:00+00:00

How can i launch a vbs script after the wifi connection has been stablished?

  • 0

How can i launch a vbs script after the wifi connection has been stablished?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:02:01+00:00Added an answer on May 23, 2026 at 9:02 am

    You could launch a VBScript that loops looking for a response from an internet site/device/whatever. When it sees it, it will execute code, otherwise it will try for up to XX minutes and abort, for example:

    Const strTarget = "cnn.com"
    
    startTime = Time
    boolExitFlag = False
    
    Do
    
        ' Check to see if I can get a ping response from target
        If Ping(strTarget) Then
    
            ' Call the code to run on connect
            Call runOnWIFI              
            boolExitFlag = True
        End If
    
    
        WScript.sleep 1000 ' Pause for 1 seconds before next attempt
    
        ' Stop trying after 5 minutes   
        If DateDiff("s", startTime, time) => 300 then boolExitFlag = True
    
    Loop while boolExitFlag <> True
    
    
    
    ' * * * * * * * * * * * * * * * * * * * * * * * * * * * 
    ' Subroutine to run when WIFI connection is detected
    ' * * * * * * * * * * * * * * * * * * * * * * * * * * * 
    Sub runOnWIFI
    
        ' INSERT CODE TO RUN ON WIFI CONNECTION HERE
    
    End Sub
    
    
    
    ' * * * * * * * * * * * * * * * * * * * * * * * * * * * 
    ' Subroutine to see if the target machine is online
    ' * * * * * * * * * * * * * * * * * * * * * * * * * * * 
    Function Ping(strHost)
    
        Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_PingStatus where address = '" & strHost & "'")
    
        z = 0
        Do    
            z = z + 1
            For Each objRetStatus In objPing        
                If IsNull(objRetStatus.StatusCode) Or objRetStatus.StatusCode <> 0 Then            
                    PingStatus = False        
                Else
                    PingStatus = True              
                End If      
            Next    
    
            ' Try a few times in case machine doesn't respond right away
            wscript.sleep 200
            If z = 4 Then Exit Do
    
        Loop until PingStatus = True
    
        If PingStatus = True Then 
            Ping = True
        Else
            Ping = False
        End If
    
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I launch an event that has accessors like this : public event
How can I launch an application with administrator rights after I have completed an
I just installed Cygwin and can launch a bash shell from windows, do ls
I have a c program which I can launch at command prompt. Is it
I have an application where I can launch a modal dialog box over a
Does anyone have an example AUTORUN.INF which can launch an MSI installer automatically when
How can I launch an application using C#? Requirements: Must work on Windows XP and
How can I launch the Safari browser or the user's default browser pointing it
In Silverlight how can I launch / navigate to another page?
In VB.net, how can you programmatically launch a .exe file? Is there a way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.