Jump to content











Photo
- - - - -

SetIfaceState - easily enable or disable network interfaces.


  • Please log in to reply
3 replies to this topic

#1 gbrao

gbrao

    Frequent Member

  • Advanced user
  • 344 posts
  •  
    India

Posted 4 weeks ago

This is related to this thread : http://reboot.pro/to...net-connection/

 

I wanted a easy way to enable/disable network connections.

 

SetIfaceState here :

 

https://sites.google...ate/information

 

Comments and suggestions welcome.



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13475 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 4 weeks ago

I wanted a easy way to enable/disable network connections.

... then asked here on reboot.pro, and then made a (closed source, and with such a "liberal" prescription as "You may not modify, rename, adapt, rent, lease, loan, sell, or create derivative works based upon this program or any part thereof.") tool in AutoIt using some of the gathered information without thanking the members who suggested possible ways, let alone credit them for the ideas, additionally ignoring the fact (given info on that thread) that the output of NETSH is localized and thus the tool can only work on English Windows, that more than one interface (even if some are physically not connected) may come out in the NETSH interface show interface output, etc....  :whistling:

 

the first show stopper on non English being ;):



	If $iinterface_name_pos == 0 Then
		MsgBox($mb_iconstop, "Error", "Cannot find header line with 'Interface Name' in output from 'netsh show interface'. Aborting.")
		Exit
	EndIf

BTW the executed command is:

$snetsh_output = f_getdosoutput("netsh interface show interface")

netsh interface show interface, not  netsh show interface

 

If you are going to use AutoIT, then I believe you can do something more universal/portable/multilingual than just a wrap-around of NETSH, *like*:

https://www.autoitsc...ork-connection/

 

 

:duff:

Wonko



#3 gbrao

gbrao

    Frequent Member

  • Advanced user
  • 344 posts
  •  
    India

Posted 4 weeks ago

OK. Will credit reboot members with a link to this post.

 

Will mention all the 'deficiencies' too.



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13475 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 4 weeks ago

Will mention all the 'deficiencies' too.

They are not "deficiencies", they are mostly only "limitations" :)

 

You could easily workaround them by simply adding a .cfg or .ini file where the "local user" fills the localized strings with the local output of netsh command and the specific strings (that may change besides by local settings/language also in different Windows OS versions) that are used as name of the local connections.

Something *like*:

[Strings]
OS=XP
[Italian]
"Interface Name"="Nome Interfaccia"

would probably do.

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users