disable lan through command prompt

P

polilop

Is there a way to disable local area connection and enable
through command prompt?
The thing i wont to do is a .bat file which i can
scheduel so it starts or disables a lan connection.
 
P

Pegasus \(MVP\)

polilop said:
Is there a way to disable local area connection and enable
through command prompt?
The thing i wont to do is a .bat file which i can
scheduel so it starts or disables a lan connection.

Rather than disabling your LAN connection, you could
change the PC's IP address on the fly like so:

netsh interface ip set address "Local Area Connection" static 125.187.7.56
255.0.0.0

This would make it impossible for the machine to communicate
with other devices on the network.
 
P

polilop

The thing is that i have a lan connection and a modem connection
when they both are active i cant ping through my modem to the remote comp
but when i disable the local area connection i am able to ping. I wish to
schedule
a bat file which will disable my lan, send a message through my modem
connection and
then activate my lan again. Someone told me to erase the gateway on my lan
but that allso
dosent work.
So when i change to this adress(255.0.0.0) do you think it will work
 
J

Jetro

Windows assigns the cost of interface (metric) on-the-fly analysing its
declared speed. Thus 10/100Mbps interface (LAN adapter) metric is lower than
any modem interface metric and IP packets are routed on more effective
(best) 10/100Mbps interface. That's why ping is going thru LAN interface.

Increase LAN metric when you establish a dial-up connection using 'route'
command similar to

route change 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 100 if {interfaceNo}

netsh int del int [name=]<string> deletes a particular interface at the
router completely and
netsh int add int [name=]<string> [[type=]full] adds an interface.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top