1.

Solve : Is there a DOS command to Disable/Enable a given Network Connection??

Answer»

Is there a DOS command to Disable/Enable a given Network Connection?

Thanks in advance for any help you can provide.No DOS specific command available however you could execute a PROGRAM from command shell to perform this.

If you have a smart switch you can automate a telnet to your MANAGED smart switch to enable/disable ports on a switch to enable/disable a connection.

If you want to have it happen at that specific computer locally executed then you can have a custom program that goes and disables the driver for the NIC or runs an automated macro that interacts with Windows. This is a very ugly solution.

The cleanest solution is to have a smart managed switch and from any system on the network you as administrator could shut off that specific port that the system is connected to.NETSHQuote

NETSH

Hmmmm forgot about NETSH.... so they could NETSH set to change configuration to make configuration outside of the normal network scope and break the connection to the network that way. I DONT know of NETSH having an enable/disable for the actual NIC...

Quote
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\user1>netsh/?

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]Use
rName] [-p Password | *]
[Command | -f ScriptFile]

The following commands are available:

Commands in this context:
? - Displays a list of commands.
add - Adds a configuration entry to a list of entries.
advfirewall - Changes to the `netsh advfirewall' context.
bridge - Changes to the `netsh bridge' context.
delete - Deletes a configuration entry from a list of entries.
dhcpclient - Changes to the `netsh dhcpclient' context.
dnsclient - Changes to the `netsh dnsclient' context.
dump - Displays a configuration script.
exec - Runs a script file.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
http - Changes to the `netsh http' context.
interface - Changes to the `netsh interface' context.
ipsec - Changes to the `netsh ipsec' context.
lan - Changes to the `netsh lan' context.
mbn - Changes to the `netsh mbn' context.
namespace - Changes to the `netsh namespace' context.
nap - Changes to the `netsh nap' context.
netio - Changes to the `netsh netio' context.
p2p - Changes to the `netsh p2p' context.
ras - Changes to the `netsh ras' context.
rpc - Changes to the `netsh rpc' context.
set - Updates configuration settings.
show - Displays information.
trace - Changes to the `netsh trace' context.
wcn - Changes to the `netsh wcn' context.
wfp - Changes to the `netsh wfp' context.
winhttp - Changes to the `netsh winhttp' context.
winsock - Changes to the `netsh winsock' context.
wlan - Changes to the `netsh wlan' context.

The following sub-contexts are available:
advfirewall bridge dhcpclient dnsclient firewall http interface ipsec lan mbn n
amespace nap netio p2p ras rpc trace wcn wfp winhttp winsock wlan

To view help for a command, type the command, followed by a space, and then
type ?.

C:\Users\user1>



Quote
C:\Users\user1>netsh lan

The following commands are available:

Commands in this context:
? - Displays a list of commands.
add - Adds a configuration entry to a table.
delete - Deletes a configuration entry from a table.
dump - Displays a configuration script.
export - Saves LAN profiles to XML files.
help - Displays a list of commands.
reconnect - Reconnects on an interface.
set - Configures settings on interfaces.
show - Displays information.

To view help for a command, type the command, followed by a space, and then
type ?.


C:\Users\user1>

Additionally there are some tricks you could do in DHCP to disallow a connection to the network based on MAC address, and blacklist a system to disallow it to get an IP lease, however if anyone has the ability to create a static IP and gateway with a corporate system that is joined to the domain they could cheat the system getting on static and USING pass thru authentication with any data shares etc.Quote from: John_L. on October 10, 2015, 07:53:53 AM
Is there a DOS command to Disable/Enable a given Network Connection?

IPCONFIG can release a given connection name.Thanks to all that replied. I was able to find:

netsh interface delete interface "Wireless Network Connection" (for example)I think a simple disable would have sufficed.
netsh interface set interface "Local Area Connection" DISABLED


Discussion

No Comment Found