Networking Forums

Networking Forums > Wireless Networking > Wireless Internet > enable/disable wireless networking batch file?

Reply
Thread Tools Display Modes

enable/disable wireless networking batch file?

 
 
David Shorthouse
Guest
Posts: n/a

 
      07-30-2004, 10:40 PM
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.


 
Reply With Quote
 
 
 
 
TedPax
Guest
Posts: n/a

 
      07-31-2004, 04:14 AM
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" <(E-Mail Removed)> wrote in message
news7AOc.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.
>
>



 
Reply With Quote
 
David Shorthouse
Guest
Posts: n/a

 
      07-31-2004, 04:55 AM
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.
>>
>>

>
>



 
Reply With Quote
 
Jerry Park
Guest
Posts: n/a

 
      07-31-2004, 05:32 AM
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...b;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
 
Reply With Quote
 
dold@enableXdis.usenet.us.com
Guest
Posts: n/a

 
      07-31-2004, 07:41 PM
Jerry Park <(E-Mail Removed)> wrote:
> Check out Microsoft's command line device manager, devcon.exe at
> http://support.microsoft.com/default...b;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...b;en-us;810020



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

 
Reply With Quote
 
David Shorthouse
Guest
Posts: n/a

 
      08-01-2004, 12:48 AM
>> 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...b;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


 
Reply With Quote
 
David Shorthouse
Guest
Posts: n/a

 
      08-01-2004, 02:24 PM
> Check out Microsoft's command line device manager, devcon.exe at
> http://support.microsoft.com/default...b;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


 
Reply With Quote
 
samtowers
Guest
Posts: n/a

 
      09-07-2004, 01:15 PM

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&2E9 8101C&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/

 
Reply With Quote
 
dold@XReXXenabl.usenet.us.com
Guest
Posts: n/a

 
      09-07-2004, 04:20 PM
samtowers <(E-Mail Removed)> 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...b;en-us;311272 >

devcon find * > all_devices.txt
revealed
PCI\VEN_10B7&DEV_1007&SUBSYS_615B10B7&REV_10\3&61A AA01&0&81 :
3Com 56K V.90 Mini PCI Modem
PCI\VEN_10B7&DEV_6055&SUBSYS_645610B7&REV_10\3&61A AA01&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

 
Reply With Quote
 
samtowers
Guest
Posts: n/a

 
      09-08-2004, 04:44 AM

Hi Al

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

Prob 1
Upon startup the wireless connection connects but ZoneAlarm does no
work until I log in. Therefore the PC is unprotected until I log i
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 of
but upon startup this causes errors with apps using PCI and while
could make them wait until the PCI devices are enabled I would rathe
be selective and just kill the NW card

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

Cheer
Sa

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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need batch file to turn-off a service based on currently connected wireless network rishikant Wireless Networks 1 10-11-2011 06:55 AM
Enable/Disable Wireless icon missing from system tray rhandrich Wireless Networks 11 06-07-2007 11:50 PM
creating a batch file to disable and enable a device? Gavin Wireless Networks 4 04-14-2006 03:33 PM
possible to disable/enable wireless network adapter via command? Arno Wireless Networks 1 04-26-2005 12:39 PM
Does frequent enable/disable of wireless card muck up registry? Ian Ferrin Wireless Networks 2 01-28-2005 08:44 PM



1 2 3 4 5 6 7 8 9 10 11