script to repair (enable/disable) wlan adapter

  • Thread starter Thread starter robert.waters
  • Start date Start date
R

robert.waters

My XP Pro SP2 laptop travels between several similar wireless networks
during the course of a day (from job to job), and I prefer to hibernate
rather than shut down between them (due to long boot time). I find
that the supposedly DHCP-set DNS server is being actually remembered
from the previous network after emerging from hibernation.
Example:
Network 1 192.168.1.0/24, DNS server is 192.168.1.16 (windows domain
controller). When I get to network 2 192.168.1.0/24, DNS server is
192.168.1.1 (SOHO router); however, 192.168.1.16 is remembered as the
DNS server, and I need to disable and then enable (or use Windows'
repair option) in order to get the settings right (just renewing the
adapter doesn't work).

My question is, is there any scripting method that will allow me to
perform this repair? Netsh only works for Windows 2003 server. I am
open to anything, vbscript, whatever. This is really a pain.

Thank you.
Robert
 
robert.waters said:
My XP Pro SP2 laptop travels between several similar wireless networks
during the course of a day (from job to job), and I prefer to hibernate
rather than shut down between them (due to long boot time). I find
that the supposedly DHCP-set DNS server is being actually remembered
from the previous network after emerging from hibernation.
Example:
Network 1 192.168.1.0/24, DNS server is 192.168.1.16 (windows domain
controller). When I get to network 2 192.168.1.0/24, DNS server is
192.168.1.1 (SOHO router); however, 192.168.1.16 is remembered as the
DNS server, and I need to disable and then enable (or use Windows'
repair option) in order to get the settings right (just renewing the
adapter doesn't work).

My question is, is there any scripting method that will allow me to
perform this repair? Netsh only works for Windows 2003 server. I am
open to anything, vbscript, whatever. This is really a pain.

Thank you.
Robert

You can set just about any TCP/IP parameter with netsh.exe.
 
Unfortunately I don't know ahead of time what the DNS server should be
(the DHCP server *should* provide it, and it probably is, but Windows
is ignoring it); the example I gave is two different networks, but in
reality it's more.
Netsh supports enabling/disabling an adapter, but only for Windows 2003
Server.

There's no WMI scripting to accomplish this?
 
robert.waters said:
Unfortunately I don't know ahead of time what the DNS server should be
(the DHCP server *should* provide it, and it probably is, but Windows
is ignoring it); the example I gave is two different networks, but in
reality it's more.
Netsh supports enabling/disabling an adapter, but only for Windows 2003
Server.

There's no WMI scripting to accomplish this?

I'm sure you can use WMI to achieve this. Ask in a scripting group.

You can use devcon.exe to enable/disable any device. AFAIK it comes
with the Windows Resource Kit.
 
Back
Top