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:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* 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
Go Back   Tech Support Forum > The IT Pro > Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Programming A discussion forum for programs and programming used in tech-related businesses.

Reply
 
LinkBack Thread Tools
Old 10-01-2009, 07:30 AM   #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.
landspeed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
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

Old 10-02-2009, 09:39 AM   #2 (permalink)
Tech, Networking Forums
 
Squashman's Avatar
 
Join Date: Apr 2005
Location: 1265 Lombardi Ave.
Posts: 1,148
OS: All of the above


Re: Is this possible? Windows scripting

What OS are they running?
Maybe the issue is they are just to far away from the AP.
Squashman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 10-02-2009, 01:43 PM   #3 (permalink)
TSF Enthusiast
 
TheOutcaste's Avatar
 
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
Of course the wireless device would have to have wireless in it's name and you would need the correct hardware id which you get from devcon listclass net
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?
TheOutcaste is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 10:01 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85