Sign in to follow this  
Followers 0
Mariah

How to check if the user is connected to LAN or WLAN

7 posts in this topic

Hi everyone, im new to this forum however still hope to get some help here. I'm looking to make this work: http://www.autoitscript.com/forum/index.php?showtopic=118205

Currently that checks if LAN and WLAN are "ENABLED" then it will disable the WLAN. You can also find the script in the attachment.

I WANT if the user is "CONNECTED" to LAN AND WLAN then disable the WLAN

Please help!!

script2.au3

Share this post


Link to post
Share on other sites



Should it work on every PC, or just on your own?


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Should it work on every PC, or just on your own?

on every pc :)

I just need a simple Condition to check if Local Area Connection and Wireless Area network both are connected to the network.

example:

if ( (local area connection = connected) AND (wireless area network = connected) ) {

msgbox("you rock");

}

hehe ;) please help me! i will pray for you ;)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You need an if statement on this AdapterTypeID and NetConnectionStatus with the win32_networkadapterclass. Have you tried to code this? It just seems like you want us to write the if statement for you.

NetConnectionStatus =2 means connected.

That post you linked to is almost all setup for you.

http://msdn.microsoft.com/en-us/library/aa394216%28v=VS.85%29.aspx

http://www.autoitscript.com/forum/index.php?showtopic=118205

Edited by targeter

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

...

Edited by cobra11

Share this post


Link to post
Share on other sites

You need an if statement on this AdapterTypeID and NetConnectionStatus with the win32_networkadapterclass. Have you tried to code this? It just seems like you want us to write the if statement for you.

NetConnectionStatus =2 means connected.

That post you linked to is almost all setup for you.

http://msdn.microsoft.com/en-us/library/aa394216%28v=VS.85%29.aspx

http://www.autoitscript.com/forum/index.php?showtopic=118205

thanks targeter!! tell me why r u so smart heheheh ;) thanks again

Share this post


Link to post
Share on other sites

for test internet connection use:

InternetTest()

If $InternetStat = 1 Then
    MsgBox(16, "Error", "You aren' t connect to internet, the program will be closed")
    Exit
EndIf

Func InternetTest()

    $InternetStat = 0

    $RetVal = Ping("www.google.it", 2000) ;put siteweb that you want
            If $RetVal Then
                Return
            EndIf
    
$InternetStat = 1

     Return
EndFunc

this wasn't what i was looking for.. thanks any way ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0