script to repair (enable/disable) wlan adapter

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
 
P

Pegasus \(MVP\)

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.
 
R

robert.waters

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?
 
P

Pegasus \(MVP\)

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.
 

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