enable/disable wireless networking batch file?

G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

Hey folks,

I have a D-Link DWL-G510 desktop NIC in a machine that frequently
suspends to RAM (by choice and preferred). After about 2-3 hours of being in
suspend mode however, the NIC no longer connects to my Linksys WRT54G.
Actually, there is apparently a connection as evidenced by the D-Link tray
software and the network connection icon, but the IP address is in the range
169.XXX.XXX. Releasing and renewing the IP from a command prompt does not
solve the problem. The only recourse that seems to work to date is to
reboot. A D-Link tech suggested that I disable then re-enable the Wireless
Network adapter from the Control Panel and, although I haven't yet tried
this to see if it works, I would much rather do this via a batch file
because this machine is used by someone who wants simplicity, quick access
and stability. Does anyone know the command prompt switches to disable and
enable a Wireless Network adapter such that I can write the batch file?

Thanks,

Dave

--
______________________________
Remove "yourclothes" to reply directly.
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

David Shorthouse wrote:

>Hey folks,
>
> I have a D-Link DWL-G510 desktop NIC in a machine that frequently
>suspends to RAM (by choice and preferred). After about 2-3 hours of being in
>suspend mode however, the NIC no longer connects to my Linksys WRT54G.
>Actually, there is apparently a connection as evidenced by the D-Link tray
>software and the network connection icon, but the IP address is in the range
>169.XXX.XXX. Releasing and renewing the IP from a command prompt does not
>solve the problem. The only recourse that seems to work to date is to
>reboot. A D-Link tech suggested that I disable then re-enable the Wireless
>Network adapter from the Control Panel and, although I haven't yet tried
>this to see if it works, I would much rather do this via a batch file
>because this machine is used by someone who wants simplicity, quick access
>and stability. Does anyone know the command prompt switches to disable and
>enable a Wireless Network adapter such that I can write the batch file?
>
>Thanks,
>
>Dave
>
>
>
Check out Microsoft's command line device manager, devcon.exe at
http://support.microsoft.com/default.aspx?scid=kb;en-us;311272

I needed this because when I take my laptop from work to home, the
device 'remembers' the DHCP server address from work and has difficulty
obtaining an IP address. Sometimes enable/disable would work, sometimes
not. I use devcon to restart the device. I'm running a logon script to
do that. (I'm using XP Pro, don't think XP Home can run scripts):

The script I'm using is:

REM Restart Wireless connection to force broadcast IP request.
REM Don't restart if ping successful.
ping -n 1 yahoo.com
if %errorlevel% EQU 0 goto end
devcon restart PCI\VEN_14E4*
:end
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

If you're using Windows 2K or XP, configure Hardware Profiles. You can
configure it so that you get a boot menu with the option of using either
card.

"David Shorthouse" <davidshorthouse@shawyourclothes.ca> wrote in message
news:D7AOc.145947$ek5.88059@pd7tw2no...
> Hey folks,
>
> I have a D-Link DWL-G510 desktop NIC in a machine that frequently
> suspends to RAM (by choice and preferred). After about 2-3 hours of being
in
> suspend mode however, the NIC no longer connects to my Linksys WRT54G.
> Actually, there is apparently a connection as evidenced by the D-Link tray
> software and the network connection icon, but the IP address is in the
range
> 169.XXX.XXX. Releasing and renewing the IP from a command prompt does not
> solve the problem. The only recourse that seems to work to date is to
> reboot. A D-Link tech suggested that I disable then re-enable the Wireless
> Network adapter from the Control Panel and, although I haven't yet tried
> this to see if it works, I would much rather do this via a batch file
> because this machine is used by someone who wants simplicity, quick access
> and stability. Does anyone know the command prompt switches to disable and
> enable a Wireless Network adapter such that I can write the batch file?
>
> Thanks,
>
> Dave
>
> --
> ______________________________
> Remove "yourclothes" to reply directly.
>
>
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

I think I must not have been clear. I only have the one wireless card. It
loses its connection to the router upon resume from suspend to RAM.

Dave

--
______________________________
Remove "yourclothes" to reply directly.

> If you're using Windows 2K or XP, configure Hardware Profiles. You can
> configure it so that you get a boot menu with the option of using either
> card.
>
>> Hey folks,
>>
>> I have a D-Link DWL-G510 desktop NIC in a machine that frequently
>> suspends to RAM (by choice and preferred). After about 2-3 hours of being
> in
>> suspend mode however, the NIC no longer connects to my Linksys WRT54G.
>> Actually, there is apparently a connection as evidenced by the D-Link
>> tray
>> software and the network connection icon, but the IP address is in the
> range
>> 169.XXX.XXX. Releasing and renewing the IP from a command prompt does not
>> solve the problem. The only recourse that seems to work to date is to
>> reboot. A D-Link tech suggested that I disable then re-enable the
>> Wireless
>> Network adapter from the Control Panel and, although I haven't yet tried
>> this to see if it works, I would much rather do this via a batch file
>> because this machine is used by someone who wants simplicity, quick
>> access
>> and stability. Does anyone know the command prompt switches to disable
>> and
>> enable a Wireless Network adapter such that I can write the batch file?
>>
>> Thanks,
>>
>> Dave
>>
>> --
>> ______________________________
>> Remove "yourclothes" to reply directly.
>>
>>
>
>
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

Jerry Park <NoReply@no.spam> wrote:
> Check out Microsoft's command line device manager, devcon.exe at
> http://support.microsoft.com/default.aspx?scid=kb;en-us;311272

> I needed this because when I take my laptop from work to home, the
> device 'remembers' the DHCP server address from work and has difficulty
> obtaining an IP address. Sometimes enable/disable would work, sometimes
> not. I use devcon to restart the device. I'm running a logon script to
> do that. (I'm using XP Pro, don't think XP Home can run scripts):

Hmmm. My wired connection has suddenly become rather sticky about picking
up a new IP address. I might try this same tool (Win2000).

Microsoft Acknowledges the problem with Wireless and Standby on XP, and
suggests waiting for the WinXP SP2, which I think is due out soon.
http://support.microsoft.com/default.aspx?scid=kb;en-us;810020



--
---
Clarence A Dold - Hidden Valley (Lake County) CA USA 38.8-122.5
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

>> I have a D-Link DWL-G510 desktop NIC in a machine that frequently
>> suspends to RAM (by choice and preferred). After about 2-3 hours of being
>> in suspend mode however, the NIC no longer connects to my Linksys WRT54G.
>> Actually, there is apparently a connection as evidenced by the D-Link
>> tray software and the network connection icon, but the IP address is in
>> the range 169.XXX.XXX. Releasing and renewing the IP from a command
>> prompt does not solve the problem. The only recourse that seems to work
>> to date is to reboot. A D-Link tech suggested that I disable then
>> re-enable the Wireless Network adapter from the Control Panel and,
>> although I haven't yet tried this to see if it works, I would much rather
>> do this via a batch file because this machine is used by someone who
>> wants simplicity, quick access and stability. Does anyone know the
>> command prompt switches to disable and enable a Wireless Network adapter
>> such that I can write the batch file?
>>
>>Thanks,
>>
>>Dave
>>
>>
> Check out Microsoft's command line device manager, devcon.exe at
> http://support.microsoft.com/default.aspx?scid=kb;en-us;311272
>
> I needed this because when I take my laptop from work to home, the device
> 'remembers' the DHCP server address from work and has difficulty obtaining
> an IP address. Sometimes enable/disable would work, sometimes not. I use
> devcon to restart the device. I'm running a logon script to do that. (I'm
> using XP Pro, don't think XP Home can run scripts):
>
> The script I'm using is:
>
> REM Restart Wireless connection to force broadcast IP request.
> REM Don't restart if ping successful.
> ping -n 1 yahoo.com
> if %errorlevel% EQU 0 goto end
> devcon restart PCI\VEN_14E4*
> :end

Great! I imagine that I'd have to modify the PCI vendor ID to suit my
device, correct?

Dave
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

> Check out Microsoft's command line device manager, devcon.exe at
> http://support.microsoft.com/default.aspx?scid=kb;en-us;311272
>
> I needed this because when I take my laptop from work to home, the device
> 'remembers' the DHCP server address from work and has difficulty obtaining
> an IP address. Sometimes enable/disable would work, sometimes not. I use
> devcon to restart the device. I'm running a logon script to do that. (I'm
> using XP Pro, don't think XP Home can run scripts):
>
> The script I'm using is:
>
> REM Restart Wireless connection to force broadcast IP request.
> REM Don't restart if ping successful.
> ping -n 1 yahoo.com
> if %errorlevel% EQU 0 goto end
> devcon restart PCI\VEN_14E4*
> :end

I modified the PCI device ID to match that of the wireless NIC and this tool
works great! I scheduled a batch file to run at log on and configured the
power management to ask for password when resuming from suspend such that
the batch file has an opportunity to run.

Thanks for the help,

Dave
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

hi All

Could I have the exact syntax to disable and enable the network card.
If I disable the network card using, what I think to be the HW id,
devcon shuts down all of my PCI devices.
The hwids for my NW card:
PCI\VEN_8086&DEV_1229&SUBSYS_B0D70E11&REV_05\4&2E98101C&0&00F0
Name: Compaq NC3121 Fast Ethernet NIC #2
Hardware ID's:
PCI\VEN_8086&DEV_1229&SUBSYS_B0D70E11&REV_05
PCI\VEN_8086&DEV_1229&SUBSYS_B0D70E11
PCI\VEN_8086&DEV_1229&CC_020000
PCI\VEN_8086&DEV_1229&CC_0200

Cheers
Sam


--
samtowers
brought to you by http://www.wifi-forum.com/
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

samtowers <samtowers.1c7siy@no-mx.forums.yourdomain.com.au> wrote:

> Could I have the exact syntax to disable and enable the network card.
> If I disable the network card using, what I think to be the HW id,
> devcon shuts down all of my PCI devices.

You don't say what command lines you are actually using, or if you might be
using cygwin rather than a command prompt bat file. You don't say why you
are trying to do this. I haven't had much luck with using reset to "fix"
my wired NIC IP address.

The scenario for me:
Win2000 SP4 caused problems for my Nortel Contivity VPN client
< http://support.microsoft.com/default.aspx?kbid=841382 >
I applied the hotfix, which cured the VPN problem, but now I have a new
problem. If my wired NIC doesn't see a connection at the time that I
hibernate, it will not pick up a new one when I resume, connected to a LAN.
That was not true prior to the hotfix.

I have tried release/renew. One or the other of those just hangs.
I have tried disable/enable from the GUI, that has no effect, still a
0.0.0.0 IP address.

I fetched devcon from
< http://support.microsoft.com/default.aspx?scid=kb;en-us;311272 >

devcon find * > all_devices.txt
revealed
PCI\VEN_10B7&DEV_1007&SUBSYS_615B10B7&REV_10\3&61AAA01&0&81 :
3Com 56K V.90 Mini PCI Modem
PCI\VEN_10B7&DEV_6055&SUBSYS_645610B7&REV_10\3&61AAA01&0&80 :
3Com 10/100 Mini P CI Ethernet Adapter

When I first tried the reset bat file, I had
devcon restart PCI\VEN_10B7*
but that reset both my 3com NIC and my 3com modem. I changed it to
devcon restart PCI\VEN_10B7&DEV_6055*

That restarts just the NIC, but still no IP address. Maybe I need to
disable it before I do the hibernate.

--
---
Clarence A Dold - Hidden Valley (Lake County) CA USA 38.8-122.5
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

Hi All

Did not explain my situation very well. Am on a W2K box with ZoneAlarm
installed and a wireless internet connection via a network card. Am
using devcon on the command line on the local machine.

Prob 1:
Upon startup the wireless connection connects but ZoneAlarm does not
work until I log in. Therefore the PC is unprotected until I log in
Purposed Solution:
1) Disable the network card at shutdown and enable it during log on.
2) Turn wireless modem on and off manually... but I'm a bit of a geek -
this is not a solution.

Have tried using
devcon disable <any HW ID>
but this disables all of my PCI devices. Wouldnt care cos box is off
but upon startup this causes errors with apps using PCI and while I
could make them wait until the PCI devices are enabled I would rather
be selective and just kill the NW card.

PS
Will try
devcon restart PCI\VEN_8086&DEV_1229*
tonight when I get home but all of my PCI devices HWIDs start with this
so dont think this will help.

Cheers
Sam


--
samtowers
brought to you by http://www.wifi-forum.com/
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

samtowers <samtowers.1c8zky@no-mx.forums.yourdomain.com.au> wrote:
> Did not explain my situation very well. Am on a W2K box with ZoneAlarm
> installed and a wireless internet connection via a network card. Am
> using devcon on the command line on the local machine.

> Prob 1:
> Upon startup the wireless connection connects but ZoneAlarm does not
> work until I log in. Therefore the PC is unprotected until I log in

I see that ZoneLabs Integrity Client is in my Startup Folder, indicating
that it wouldn't start until I was logged in. That's an interesting point,
and a gaping hole in the scheme of things, it would appear. I might do
some testing tomorrow.

> Have tried using
> devcon disable <any HW ID>

There's the shabby command line representation again.
I gave better examples than you do.

> but this disables all of my PCI devices. Wouldnt care cos box is off

I don't know why that would be true.

> devcon restart PCI\VEN_8086&DEV_1229*
> tonight when I get home but all of my PCI devices HWIDs start with this
> so dont think this will help.

I don't see how all of your PCI devices can have the same Vendor ID.
Ahh, that's the PCI bridge.
You want the NIC.
devcon find *
PCI\VEN_8086&DEV_7110&SUBSYS_00000000&REV_02\3&61AAA01&0&38 : Intel 82371AB/EB PCI to ISA bridge (EIO mode)
.... a bunch of others, but no NIC.

--
---
Clarence A Dold - Hidden Valley (Lake County) CA USA 38.8-122.5
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

Hi All again

Firstly apologies, my previous entry was wrong. Not all of my PCI
devices start with that vendor ID. I did that from memory - was at work
not at my home pc

Moving on...
this worked

I:\>devcon restart =net @PCI*
PCI\VEN_8086&DEV_1229&SUBSYS_B0D70E11&REV_05\4&2E98101C&0&00F0:
Restarted
1 device(s) restarted.

because there was only one PCI device in the class " net " . It didnt
matter that the cmd shell was having issues with & - see below

Thanks for all your help

Cheers

Sam

PS
Output of
I:\>devcon restart
PCI\VEN_8086&DEV_1229&SUBSYS_B0D70E11&REV_05\4&2E98101C&0&00F0: Compaq
NC3121 Fast Ethernet NIC #2

PCI\VEN_8086&DEV_1229&SUBSYS_B0D70E11&REV_05\4&2E98101C&0&00F0:
Restarted
PCI\VEN_8086&DEV_244E&SUBSYS_00000000&REV_C2\3&267A616A&0&F0: Restarted
(CTRL+C here - 12 devices to go...blah blah blah then..)
PCI\VEN_8086&DEV_24D0&SUBSYS_00000000&REV_02\3&267A616A&0&F8: Requires
reboot
'DEV_1229' is not recognized as an internal or external command,
operable program or batch file.
'SUBSYS_B0D70E11' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
'2E98101C' is not recognized as an internal or external command,
operable program or batch file.
'0' is not recognized as an internal or external command, operable
program or batch file.
'00F0:' is not recognized as an internal or external command, operable
program or batch file.

I:\>

Would appear the command shell is having probs with the & symbol.
Looked on the net for the cmd line issues re: the & symbol looking for
an override but was a bit fruitless.


PPS
>>If my wired NIC doesn't see a connection at the time that I
hibernate, it >>will not pick up a new one when I resume, connected to
a LAN.

Try releasing the IP address before hibernating, then renewing when
awake again.

I swap between IPX and IP networks regulary at work on a laptop. Used
to pull the cable, plug in other NW cable and then renew it but
ipconfig died regulary. Now I release it before disconnecting and it is
excellent.
Note: The ipconfig /renew reports an error. I just type ipconfig (no
switches) and the correct IP is displayed on the screen. Doesnt hang at
all and no reboots.

Also noted that apps like Outlook dont like their network conns
disappearing without warning. The above scenario fixed that too.


--
samtowers
brought to you by http://www.wifi-forum.com/
 
G

Guest

Guest
Archived from groups: alt.internet.wireless (More info?)

dold@xrexxenabl.usenet.us.com wrote:
> I see that ZoneLabs Integrity Client is in my Startup Folder, indicating
> that it wouldn't start until I was logged in.

The program in the startup folder is the user interface. It doesn't start
until you log in, so as to verify that you are authorized to make changes
to the firewall. Explained for the Integrity client in
http://download.zonelabs.com/bin/media/pdf/ZLInt45_archWP.pdf
I assume that the free ZoneAlarm is the same, since it also has a vsmon.exe.

The firewall itself is %windows%\system\Zone Labs\vsmon.exe
which is running, and blocking connections, before login.
I tested that this morning. With a fresh reboot, I connected perfmon.msc
from a trusted computer to the laptop under test. I was able to see
vsmon.exe running. After I logged in, I could see iclient.exe running. An
untrusted computer was not able to connect before or after login.

---
Clarence A Dold - Hidden Valley (Lake County) CA USA 38.8-122.5