Sign in to follow this  
Followers 0
j-p

Activate / Deactivate LAN connection

8 posts in this topic

Hi,

I would like to activate and deactivate my lan connection. is that somehow possible?

Thank You

j-p

Share this post


Link to post
Share on other sites



Hi,

I would like to activate and deactivate my lan connection. is that somehow possible?

Thank You

j-p

check out netsh, you may be able to do what you want with that. i have a script at home that toggles dhcp or static ip settings for when i'm on my own network.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

check out netsh, you may be able to do what you want with that. i have a script at home that toggles dhcp or static ip settings for when i'm on my own network.

Hi,

maybe you should download devcon.exe.

But I´ll try to lookup the netsh command, too. :lmao:

So long,

Mega


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

Hi,

maybe you should download devcon.exe.

But I´ll try to lookup the netsh command, too. ;)

So long,

Mega

netsh isn´t able to disable a network card "connection". :lmao:

So long,

Mega

P.S.: So, devcon.exe rules I think. o:)


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

#5 ·  Posted (edited)

i did a quick google search and i found this for netsh

"

netsh interface set interface "Wireless Network Connection" Disable

To enable the device substitute Disable with Enable."

http://www.computing.net/windows2003/wwwbo...forum/4094.html

so something like this should work

$netconnection = Wireless Network Connection

_rundos('netsh interface set interface "' & $netconnection &'" Disable')

or

$netconnection = Wireless Network Connection

RunWait( @Comspec & ' /c netsh interface set interface "' & $netconnection &'" Disable')

the connection names are located in the registry

in HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}...in each sub folder theirs a folder called connections...and thets a string called name....

ex....my wareless card name is

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\{82993084-E302-4041-9CE7-DB503E8062C5}\Connection

Name="Wireless Network Connection"

edit...i tried that command...but it didn't seem to work

edit2...i am getting a syntax error...but it does apear to do what you need

C:\Documents and Settings\Administrator>netsh interface set interface "Wireless

Network Connection" DISABLED

One or more essential parameters not specified

The syntax supplied for this command is not valid. Check help for the correct sy

ntax.

Usage set interface [name = ]IfName

[ [admin = ] ENABLED|DISABLED

[connect = ] CONNECTED|DISCONNECTED

[newname = ] NewName ]

Sets interface parameters.

IfName - the name of the interface

admin - whether the interface should be enabled (non-LAN only).

connect - whether to connect the interface (non-LAN only).

newname - new name for the interface (LAN only).

Notes:

- At least one option other than the name must be specified.

- If connect = CONNECTED is specified, then the interface

is automatically enabled even if the admin = DISABLED

option is specified.

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites

Hi,

did you test it? I think, netsh can only disable WAN-connections.

Would be nice, if I am wrong.

So long,

Mega


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

did you test it? I think, netsh can only disable WAN-connections.

i think you are correct...it says that in the syntax " (non-LAN only)."...if i find anything else i will let you know

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

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