For some reason one of our servers won't set its manually-defined IP address after a reboot (PING <servername> just times out), and it is necessary to disable and enable one of the network interfaces to return things to normal.
In the short term, until the matter can be looked into more deeply, I'd like to schedule a quick BATch job to perform this function at startup time.
Has anyone used commands like
netsh interface set interface "Local Area Connection" DISABLED
netsh interface set interface "Local Area Connection" ENABLED
and did they find them successful?
Is there a better way?
Command to disable/enable a network interface
-
- PlatinumLounger
- Posts: 5411
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Command to disable/enable a network interface
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Command to disable/enable a network interface
Those netsh commands supposedly work on Windows Server 2003 but not on XP.
You might try devcon (see Re: DOS command-line to eject a USB drive); you can get the device id that you need from Device Manager.
You might try devcon (see Re: DOS command-line to eject a USB drive); you can get the device id that you need from Device Manager.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 5411
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Command to disable/enable a network interface
Thanks, Hans - I already tried DevCon on my XP Pro PC:
DevCon disable "Intel(R) PRO/100 VE Network Connection"
and it just says No Devices Disabled - so I think I must be choosing the wrong 'name'...
DevCon disable "Intel(R) PRO/100 VE Network Connection"
and it just says No Devices Disabled - so I think I must be choosing the wrong 'name'...
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Command to disable/enable a network interface
I think you need to use the hardware ID (without quotes), not the device name.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Command to disable/enable a network interface
Here's a screenshot from my PC - it's in Dutch but you'll get the idea (or ID ):
The hardware ID is the common part before the &, so to disable the network connection, I should be able to use
devcon.exe disable PCI\VEN_14E4
The hardware ID is the common part before the &, so to disable the network connection, I should be able to use
devcon.exe disable PCI\VEN_14E4
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 5411
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Command to disable/enable a network interface
Thanks - bizarrely my hardware ID was PCI\VEN_8086!
On my XP Pro box, the Devcon Disable command for PCI\VEN_8086 disabled 9 devices (four failed) and the Enable enabled 13!
If I use the entire hardware string there are problems with the ampersands being interpreted as connecting two 'commands'. Putting double quotes round the whole string causes it to be ignored.
Think I'm going to work with NETSH on the server...
On my XP Pro box, the Devcon Disable command for PCI\VEN_8086 disabled 9 devices (four failed) and the Enable enabled 13!
If I use the entire hardware string there are problems with the ampersands being interpreted as connecting two 'commands'. Putting double quotes round the whole string causes it to be ignored.
Think I'm going to work with NETSH on the server...
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Command to disable/enable a network interface
That sounds like a safer (and easier) solution...
Best wishes,
Hans
Hans