Jump to content

- - - - -

How can I (easily) connect/disconnect a LAN/Ethernet connection?

  • Please log in to reply
26 replies to this topic

#26 gbrao


    Frequent Member

  • Advanced user
  • 382 posts

Posted 16 May 2017 - 03:25 AM

Just came across this : NetDisabler




Usage is very simple , there are 3 Internet blocking methods yo can choose one/all of them or you can use a combination
1. Disable devices
2. Block with DNS
3. Block with Windows firewall

After selecting use Apply button to complete the Operation, to bring the Internet back just remove the ticks and apply them. Under menu button you can choose your Network Adapers , you can set a password , open Device Manager, Network Connections or Firewall settings


I'll try it out on my other "test" PC - these days I'm slightly paranoid.

#27 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 May 2017 - 02:12 PM

Well, there is also the Nirsoft tool, working from wIndows 2000 up to 10, I thought we were talking "built-in" (and command line):



Like most Nirsoft utilities it is possible to parse the output by saving to an empty-name file and piping it, example:

NetworkInterfacesView.exe  /stab "" | Find "" /v

and it has a /enable and /disable switch alright (and it has both 32 and 64 bit version).


It correctly filters the "real" NIC's :) but the "generic" issue when more than one adapter is present remains, the Status column has values "Operational" and "Hardware Disconnected", but nothing prevents someone to have two or more NIC's "Operational", so one needs anyway to manually find the "right" interface (by means of the GUI) and then use its "localized" connection name, the manufacturer's "device name" or - advised - its GUID in the enable/disable command.



SET /A Counter=1
::Get Column Names
FOR /F "tokens=* delims=," %%A IN ('NetworkInterfacesView.exe /scomma "" ^| FIND /v ""') DO SET Columns=%%A&GOTO :Get_Index
CALL :Col_names %Columns: =_%
FOR /F "skip=1 tokens=* delims=," %%? IN ('NetworkInterfacesView.exe /scomma "" ^| FIND /v ""') DO SET Columns=%%?&CALL :prettify


IF %1.==. SET /A Counter=1&GOTO :EOF
SET %1=Col_x%Counter%
SET Col_x%Counter%=%1
SET /A Counter+=1
GOTO :Col_names


SET Columns=%Columns:&=_AND_%
SET Columns=%Columns: =_%
SET Columns=%Columns:,,=,N/A,%
SET Columns=%Columns:,,=,N/A,%
FOR /L %%A IN (1,1,18) DO SET Col_x%%A=N/A
CALL :Number_Cols %Columns%
IF !%IP_Address%!==N/A SET %IP_Address%=xxx.xxx.xxx.xxx
SET %IP_Address%=        !%IP_Address%!
SET %IP_Address%=!%IP_Address%:~-15,15!
IF !%Status%!==Operational SET %Status%=Y
IF !%Status%!==Hardware_Disconnected SET %Status%=N
IF !%MAC_Address%!==N/A SET %MAC_Address%=XX-XX-XX-XX-XX-XX
SET Line=!%Status%! !%MAC_Address%! !%Interface_GUID%! !%Device_Name%:_= !
ECHO %Line:~0,79%


IF %1.==. SET /A Counter=1&GOTO :EOF
SET Col_x%Counter%=%1
SET /A Counter+=1
GOTO :Number_Cols



  • gbrao likes this

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users