Console commands to enable/disable a network adapter

boran

Golden Member
Jun 17, 2001
1,526
0
76
hi, I was wondering if windows 2000 has a command line command to enable or disable a network adapter (that does the same thing as if you right click the adapter and then select enable or disable) this would be very handy, because at the moment windows seaches the PC names over the first network connection it has whereas I want it to look at my wireless connection first and at my wired connection later.

thanks in advance,
Boran.
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
sorry, I'm afraid that doesnt do what i'd need to do :/

but thanks anyways.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
you should be able to change the binding order so the wins client on your wireless card is listed first.

it should be under your network control panel
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
thanks spidey07 but your setting didnt do the trick either, right now my setup works as I want it to work with one caveat, when I reboot my main rig (desktop) I have to manually disable and enable my wired connection. once that is done everything works fine. hence if I could do that action in a batchfile i'd put it in startup and be gone withit, for the moment i'll live with it, it's not like I reboot everyday anyways.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Originally posted by: boran
thanks spidey07 but your setting didnt do the trick either, right now my setup works as I want it to work with one caveat, when I reboot my main rig (desktop) I have to manually disable and enable my wired connection. once that is done everything works fine. hence if I could do that action in a batchfile i'd put it in startup and be gone withit, for the moment i'll live with it, it's not like I reboot everyday anyways.

gotcha.

I was getting at "you can tell windows where to look first" angle. But sometimes windows doesn't listen.

;)

It gets real funny when you have multiple network adapters in a machine...it will endless search for stuff on the card you don't want it to.

this is windows going "hey, where are you...who's got a list of services for me?" etc. "normally" if you tell it where to look it responds better.

You can go so far as disabling WINS client on an adapter where there are no netbios servers (network shares, etc)
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
well, we do not have a wins server, which would greatly enhance the whole routing issue methinks, right now all network name resolving is done with netbios, so the reason it works now is because i've disabled the netbios on both wired connections.

I'll try the auto-negotiation thing this afternoon tho.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Originally posted by: boran
well, we do not have a wins server, which would greatly enhance the whole routing issue methinks, right now all network name resolving is done with netbios, so the reason it works now is because i've disabled the netbios on both wired connections.

I'll try the auto-negotiation thing this afternoon tho.

the wins client is actuall the netbios resolver (also called workstation service)

this is what finds names. and in your case, by broadcast.

disabling netbios on a card you don't want it on is an awesome way to go. helps avoid confusing windows.
 

Goosemaster

Lifer
Apr 10, 2001
48,775
3
81
Originally posted by: boran
hi, I was wondering if windows 2000 has a command line command to enable or disable a network adapter (that does the same thing as if you right click the adapter and then select enable or disable) this would be very handy, because at the moment windows seaches the PC names over the first network connection it has whereas I want it to look at my wireless connection first and at my wired connection later.

thanks in advance,
Boran.

changing the metric might work.
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
Originally posted by: Goosemaster
changing the metric might work.

1: what is it
2: how do I go about changing it
3: what does it actually do

thanks.
 

Goosemaster

Lifer
Apr 10, 2001
48,775
3
81
Originally posted by: boran
Originally posted by: Goosemaster
changing the metric might work.

1: what is it
2: how do I go about changing it
3: what does it actually do

thanks.

the administrative distance or many other forms of metrics serve to define the reliability and capability of a connection. If you were to modify the metrics of an interface, it would modify the propensity for the router to choose that route vs another.

I believe there is an option in "network properties">your interface"LAN connection">properties>(NIC) properties>

I am not sure if they use the word metric. Spidey alluded to the same thing, except I cannot verify the exact wording of the option as I would have to have a PC in front of me with that brand of NIC installed to find out:(
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
I can find a lot of settings there, but imho they're all kinda cryptic and if i'm not mistaking, setting stuff wrongly will cause troubles.

nothing about metric tho.
 

Fencer128

Platinum Member
Jun 18, 2001
2,700
1
91
Hi,

The metric property is listed under the advanced section of TCP/IP properties of the network connections window. Not the NIC (adapter) properties.

Cheers,

Andy
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
ah, thank's, i'll see what difference it makes.

edit: appearently cant find it there, is it something new of winXP (I've got win2K pro)
 

cscheune

Junior Member
Aug 6, 2004
1
0
0
Salut Boran,

just have the same task and found the following hint, what may be a step into a fitting direction:

http://www.jsiinc.com/subp/tip7900/rh7999.htm

remotly eable or disable power for the nic!

Discription is concerning Windows XP - just checking out if this may work with 2K.

gonna let you hear what/if it works ...

cu, chris


... checked it out, doesn't seem to be of any help.

MS devcon.exe tool (in my case) stops the howle class isn't a solution either - still searching, too.

Reading that http://support.microsoft.com/default.aspx?scid=kb;en-us;262265 - it may become a bit more tricky to find a fitting comand for disabling, but may be the change of IP address as discribed can help.


cu, chris
 

Fencer128

Platinum Member
Jun 18, 2001
2,700
1
91
Originally posted by: boran
ah, thank's, i'll see what difference it makes.

edit: appearently cant find it there, is it something new of winXP (I've got win2K pro)

I am using XP Pro. I haven't a 2k machine nearby, so I'm afraid I can't point out where the metric setting is exactly.

Good luck and please post the results when you find the setting,

Andy
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
Salut Boran,

just have the same task and found the following hint, what may be a step into a fitting direction:

http://www.jsiinc.com/subp/tip7900/rh7999.htm

remotly eable or disable power for the nic!

Discription is concerning Windows XP - just checking out if this may work with 2K.

gonna let you hear what/if it works ...

cu, chris

that batch doesnt work under 2K since win2K doesnt have registry set commands in batch files (or console)
it also seems to be talking about power saving, which is something different methinks.


. checked it out, doesn't seem to be of any help.

MS devcon.exe tool (in my case) stops the howle class isn't a solution either - still searching, too.

Reading that http://support.microsoft.com/default.aspx?scid=kb;en-us;262265 - it may become a bit more tricky to find a fitting comand for disabling, but may be the change of IP address as discribed can help.


cu, chris

the netsh command doesnt help much either it's meant to be used for specific protocols and less for specific adapters, also I didnt found anything which actually enables or disables a network adapter within the netsh commands.

Thanks tho.

Fencer128: I havent found it yet, and I have looked reaallly hard (twice even ! ;)) so I doubt win2K has it. I'll look at my laptop tomorrow, that one has winXP.
 

boran

Golden Member
Jun 17, 2001
1,526
0
76
it's fixed guys ! :) a friend of me found this tool called DevCon which is a command line device manager, and after a looong bit of fiddeling (cmd takes a new line if you use &, duh) I finally was able to make myself a shutdown and startup script.

shutdown:
devcon disable =net "@PCI\VEN_8086&DEV_103A&SUBSYS_30138086&REV_81\4&11C9F252&0&40F0"

startup:
sleep 6
devcon enable =net "@PCI\VEN_8086&DEV_103A&SUBSYS_30138086&REV_81\4&11C9F252&0&40F0"

(sleep is a program I got from somewhere and it just halts execution x seconds)

this way everything works exacly as i'd like it to work.

hope this helps someone else with similar problems.

Thanks all!