Trying to build command line (for .bat shortcut) to repair WiFiconnection

D

David Karr

I'm on WinXP.

In my environment and hardware, I find that I have to "Repair" my WiFi
connection quite often. When I come out of standby, it often fails to
find the correct router. After I do the "Repair", it works fine.

As I don't expect this to change anytime soon, I'd like to figure out
how I can build a command line that will do what "Repair" on the
context menu for the Wifi does, so I can put that in a .bat file
that's easier to execute than what I have to do now. It's a simple
change to the process, but it would be a little easier for me.

Can anyone suggest how I would build a command line or bat script that
could do this?
 
P

Pegasus [MVP]

David Karr said:
I'm on WinXP.

In my environment and hardware, I find that I have to "Repair" my WiFi
connection quite often. When I come out of standby, it often fails to
find the correct router. After I do the "Repair", it works fine.

As I don't expect this to change anytime soon, I'd like to figure out
how I can build a command line that will do what "Repair" on the
context menu for the Wifi does, so I can put that in a .bat file
that's easier to execute than what I have to do now. It's a simple
change to the process, but it would be a little easier for me.

Can anyone suggest how I would build a command line or bat script that
could do this?

I had the same problem with my D-Link AirPlus G DWL-G122 Wireless USB
Adapter. By trial and error I found that I had to enter Sleep mode by
killing one of the D-Link executables, then restart it after waking up the
computer. This, of course, is scriptable. None of the other methods I tried
would work reliably but this one does.
 
B

BillW50

In Pegasus [MVP] typed on Wed, 23 Sep 2009 22:23:31 +0200:
I had the same problem with my D-Link AirPlus G DWL-G122 Wireless USB
Adapter. By trial and error I found that I had to enter Sleep mode by
killing one of the D-Link executables, then restart it after waking
up the computer. This, of course, is scriptable. None of the other
methods I tried would work reliably but this one does.

Have you both tried to just simply turn the WiFi off before going into
sleep mode? Then turning it back on when you wake it up?

If that doesn't work, how about disabling the WiFi through the Device
Manager? Just run "devmgmt.msc" as a shortcut.

Btw, does the connection say it is connected, but it just isn't
authenticated?
 
E

Elmo

David said:
I'm on WinXP.

In my environment and hardware, I find that I have to "Repair" my WiFi
connection quite often. When I come out of standby, it often fails to
find the correct router. After I do the "Repair", it works fine.

As I don't expect this to change anytime soon, I'd like to figure out
how I can build a command line that will do what "Repair" on the
context menu for the Wifi does, so I can put that in a .bat file
that's easier to execute than what I have to do now. It's a simple
change to the process, but it would be a little easier for me.

Can anyone suggest how I would build a command line or bat script that
could do this?

Open Device Manager, open the properties on your ethernet card, WiFi
device, or whatever, click the Power tab, and deselect "Allow the
computer to turn off this device to save power".

You can do the same thing with a USB device by disabling the power
saving feature of each "USB Root Hub" entry.
 
D

David Karr

Open Device Manager, open the properties on your ethernet card, WiFi
device, or whatever, click the Power tab, and deselect "Allow the
computer to turn off this device to save power".

Interesting. Looking at the warning that unchecking this gives, what
is the impact of this when the computer is in standby? Does that mean
after I put the box in standby, it might spontaneously come out of
standby when I'm not expecting it?
 
B

BillW50

In Elmo typed on Wed, 23 Sep 2009 16:54:29 -0400:
Open Device Manager, open the properties on your ethernet card, WiFi
device, or whatever, click the Power tab, and deselect "Allow the
computer to turn off this device to save power".

You can do the same thing with a USB device by disabling the power
saving feature of each "USB Root Hub" entry.

Isn't the side effect of this is to cause the machine to wake up on its
own?
 
D

David Karr

InPegasus [MVP] typed on Wed, 23 Sep 2009 22:23:31 +0200:




Have you both tried to just simply turn the WiFi off before going into
sleep mode? Then turning it back on when you wake it up?

That's a pain. Considering this problem doesn't always occur, it's a
burden to have to do this. It would be easier if I could just double-
click a shortcut after coming out of standby if I saw the WiFi was
messed up.
If that doesn't work, how about disabling the WiFi through the Device
Manager? Just run "devmgmt.msc" as a shortcut.

Btw, does the connection say it is connected, but it just isn't
authenticated?

In my case, the router that I need to connect to (an authenticated
one) isn't in the list of available networks. After I do the repair,
it shows up.
 
P

Pegasus [MVP]

BillW50 said:
In Pegasus [MVP] typed on Wed, 23 Sep 2009 22:23:31 +0200:

Have you both tried to just simply turn the WiFi off before going into
sleep mode? Then turning it back on when you wake it up?

If that doesn't work, how about disabling the WiFi through the Device
Manager? Just run "devmgmt.msc" as a shortcut.

Btw, does the connection say it is connected, but it just isn't
authenticated?

Great ideas but they do not work for this particular adapter. The problem
executable (wzcsldr2.exe) has a tendency to crash when the machine comes out
of sleep mode, requiring a reboot. Killing it before and re-enabling it
after gets around the problem.
 
B

BillW50

In
David Karr typed on Wed, 23 Sep 2009 14:19:00 -0700 (PDT):
That's a pain. Considering this problem doesn't always occur, it's a
burden to have to do this. It would be easier if I could just double-
click a shortcut after coming out of standby if I saw the WiFi was
messed up.


In my case, the router that I need to connect to (an authenticated
one) isn't in the list of available networks. After I do the repair,
it shows up.

Well okay. Copy the lines below and name it "flushdns.cmd" and give that
a shot. If it works, you can give it a shortcut.

ipconfig /release
ipconfig /renew
ipconfig /flushdns
ipconfig /registerdns
 
B

BillW50

In Pegasus [MVP] typed on Wed, 23 Sep 2009 23:25:44 +0200:
Great ideas but they do not work for this particular adapter. The
problem executable (wzcsldr2.exe) has a tendency to crash when the
machine comes out of sleep mode, requiring a reboot. Killing it
before and re-enabling it after gets around the problem.

Oh... probably an incompatibility with something else. Does using
Microsoft Wireless Zero Configurator instead solve the problem?
Secondly, are you sure you need it to be running anyway to use the WiFi?
 
P

Pegasus [MVP]

BillW50 said:
In Pegasus [MVP] typed on Wed, 23 Sep 2009 23:25:44 +0200:

Oh... probably an incompatibility with something else. Does using
Microsoft Wireless Zero Configurator instead solve the problem? Secondly,
are you sure you need it to be running anyway to use the WiFi?

I think we're getting sidetracked from the OP's question. I've solved my
problem - if my solution is in any way relevant to the OP's problem then
I'll gladly continue the discussion.
 
D

David Karr

InDavid Karr typed on Wed, 23 Sep 2009 14:19:00 -0700 (PDT):






Well okay. Copy the lines below and name it "flushdns.cmd" and give that
a shot. If it works, you can give it a shortcut.

ipconfig /release
ipconfig /renew
ipconfig /flushdns
ipconfig /registerdns

I was aware of this strategy, but I thought it wouldn't be specific to
the WiFi adapter. However, when I looked at the help for ipconfig
(I've never looked at it before), I see that I can do:

ipconfig /release *Wireless*
ipconfig /renew *Wireless*

and that just does what I want and nothing else.

Thanks.
 
E

Elmo

BillW50 said:
In Elmo typed on Wed, 23 Sep 2009 16:54:29 -0400:

Isn't the side effect of this is to cause the machine to wake up on its
own?

If so, you could turn off all "Wake On" options in the BIOS. But I
doubt it would cause the machine to wake.
 
B

BillW50

In Elmo typed on Wed, 23 Sep 2009 23:02:48 -0400:
If so, you could turn off all "Wake On" options in the BIOS. But I
doubt it would cause the machine to wake.

M.I.5¾ (he posts in this newsgroup) has a laptop that wakes up all of
the time. He never has figured out why? So his fix is to just remove the
battery when he shuts down. I always remove my laptop batteries anyway
if I am on AC or shutdown. But that would still bug me and I would
investigate why and fix it.
 
B

BillW50

In
David Karr typed on Wed, 23 Sep 2009 15:19:58 -0700 (PDT):
I was aware of this strategy, but I thought it wouldn't be specific to
the WiFi adapter. However, when I looked at the help for ipconfig
(I've never looked at it before), I see that I can do:

ipconfig /release *Wireless*
ipconfig /renew *Wireless*

and that just does what I want and nothing else.

Thanks.

Glad to hear it David. I guess you can use the asterisk too for a
wildcard. <vbg>
 
D

David Karr

InDavid Karr typed on Wed, 23 Sep 2009 14:19:00 -0700 (PDT):






Well okay. Copy the lines below and name it "flushdns.cmd" and give that
a shot. If it works, you can give it a shortcut.

ipconfig /release
ipconfig /renew
ipconfig /flushdns
ipconfig /registerdns

Actually, I determined this morning that this didn't help. I found it
wasn't seeing the correct router, and I ran this script twice, and it
still didn't find it. I then ran "Repair" again, and it fixed it. It
appears that doing a "release" on the IP address isn't the same as
disabling the adapter (obviously).
 
B

BillW50

In
David Karr typed on Thu, 24 Sep 2009 08:48:32 -0700 (PDT):
Actually, I determined this morning that this didn't help. I found it
wasn't seeing the correct router, and I ran this script twice, and it
still didn't find it. I then ran "Repair" again, and it fixed it. It
appears that doing a "release" on the IP address isn't the same as
disabling the adapter (obviously).

Bummer! Well what is your plan now? Sometimes newer drivers work better.
Sometimes older drivers work better yet. And sometimes using some or the
old with some of the new is the only thing that works.
 

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