![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Sep 2009
Posts: 2
OS: XP
|
Is this possible? Windows scripting
The issue with the netbooks here in my workplace isnt the issue at this moment. Theres nothing I can do to fix them, the problem is they have junky wireless cards that will just keep dropping connection(Its not a lot but it can be annoying for teachers).
I come to you guys for assistance. Does anyone know how to write a script/batch file which will automatically disable/re-enable the wireless card whenever it drops connection? This honestly would save so much time! I personally have no clue on programming(other than the occasional batch file). Is this even possible? Thanks alot. |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#3 (permalink) |
|
TSF Enthusiast
Join Date: Mar 2009
Location: Portland, OR
Posts: 822
OS: MS-Dos 6.22 - Win7
|
Re: Is this possible? Windows scripting
Vista can enable/disable adapters via a WSH script. XP can't. You can use the devcon utility to disable devices.
If you want it to automatically detect when the connection goes down, you'd need to be running something to monitor the connection, either via a ping, or using WMI to check the status. Either by a scheduled task that runs every minute or two, or a batch file that constantly checks the status, sleeps for XX seconds then checks again. Google easily found scripts from Microsoft's scripting guys site for Vista: How Can I Tell If a Wireless Network Adapter is Connected to the Network? How Can I Enable or Disable My Network Adapter? On XP you can use the above script to check status, or use WMIC and something like this: Code:
:_Check
Sleep 30
For /F "Tokens=1 Delims=" %%I In ('wmic nic Where "'Name Like '%wireless%'" get NetConnectionStatus') Do Set _Status=%%I
If %_Status%==2 Goto _Check
devcon disable "PCI\VEN_8086&DEV_27DC&SUBSYS_01A71028&REV_01"
devcon enable "PCI\VEN_8086&DEV_27DC&SUBSYS_01A71028&REV_01"
Goto _Check
Status codes are listed in the WSH Script link. You might want to check what status it displays when it's not working, and check for the Connecting status (Status=1). Wouldn't want to disable the card if it's in the middle of re-connecting.
__________________
Microsoft MVP - Windows Desktop Experience Of course I know all the answers; I just don't always match the answers to the right questions. Rated R for Violence -- When your PC flies through a window, that's violent, right? |
|
|
|
![]() |
| Thread Tools | |
|
|