Bill, Chris,
I read your postings about how to make a batch file to disable and enable your wireless devices using batch files or VB scripts and I wondered to myself, is there a way to do both with one batch file? Well there has to be, so I spent some time tonight and improved on your idea... Which made it easier to run a shortcut to a hotkey on my Keybaord...
This is what I came up with...
NOTE: some of this was just playing around with various commands to see the result, but I decided to keep it in there cause there are always the ID10T's that just copy/past but don't read...
Hope this helps! Ben
ECHO OFF
CLS
ECHO Checking Wireless Adapter.....
devcon status PCI\VEN_168C>c:\wireless.txt 2>&1
; In this section I ran a status check on my wireless adapter then PRINTED it to a txt file
IF ERRORLEVEL ==1 GOTO Q
; Here it checks for any errors when attempting to run devcon, if it finds one it sends you down to "Q" where it informs you of the problem and asks to send you to the MS website...
find /c "disabled." c:\wireless.txt
; here it searches for the string "Disabled." in the txt file, and it what the file above will say if it is there. If it finds "Disabled."
CLS
ECHO Checking Wireless Adapter.....
IF ERRORLEVEL ==1 GOTO D
GOTO E
then is sends to "E" where it enables the device. If not found it send to "D" where it disables the device.
:D
ECHO Disabing Wireless card.....
devcon disable PCI\VEN_168C
GOTO Z
:Q
CLS
ECHO Error:
ECHO You must first download DevCon command-line utility from Microsoft's website
ECHO then place it in your windows\system32 folder.
set choice=
set /p choice=TO go there now, press the "1" Key, or press any other key to exit...
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' GOTO IE
GOTO Z
:IE
START /MAX c:\progra~1\intern~1\iexplore.exe http://support.microsoft.com/kb/311272
GOTO Z
:E
ECHO Enabing Wireless card.....
devcon enable PCI\VEN_168C
:Z
del /Q wireless.txt
ECHO Done.
@ECHO ON