PC Review


Reply
Thread Tools Rate Thread

How deactivate-reactivate a hardware component and start a service by script / command-line ?

 
 
MoiMeme
Guest
Posts: n/a
 
      22nd Jan 2009

Hi,

have my USB Wireless dongle constatntly dropping ( although drivers ok and
up-to-date, constantly awake etc)

Have to deactivate it, re-activate it and start a services which it relies
on to most often regain connetcion to the web.

Doing theses maneuvers is tedious so I am looking for a simpler way to
achieve it with one click on a batch or script

Possible ?

The dongle I use is an ASUS Wireless USB Network Adapter ( with Ralink
drivers)

TIA


 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      22nd Jan 2009


"MoiMeme" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> have my USB Wireless dongle constatntly dropping ( although drivers ok and
> up-to-date, constantly awake etc)
>
> Have to deactivate it, re-activate it and start a services which it relies
> on to most often regain connetcion to the web.
>
> Doing theses maneuvers is tedious so I am looking for a simpler way to
> achieve it with one click on a batch or script
>
> Possible ?
>
> The dongle I use is an ASUS Wireless USB Network Adapter ( with Ralink
> drivers)
>
> TIA


Hard to say. Perhaps stopping, then restarting the service would be
sufficient. With my own USB dongle the commands would be:
@echo off
net stop ANIWZCSdService
net start ANIWZCSdService


 
Reply With Quote
 
MoiMeme
Guest
Posts: n/a
 
      22nd Jan 2009

Ok for the service. That works.

But most often I have to deactivate the dongle in hardware manager, the
reactivate it .

Can that be done as well ?

( Soory for direct reply ! was not intended so !)

"Pegasus (MVP)" <(E-Mail Removed)> a écrit dans le message de news:
%(E-Mail Removed)...
>
> "MoiMeme" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi,
>>
>> have my USB Wireless dongle constatntly dropping ( although drivers ok
>> and up-to-date, constantly awake etc)
>>
>> Have to deactivate it, re-activate it and start a services which it
>> relies on to most often regain connetcion to the web.
>>
>> Doing theses maneuvers is tedious so I am looking for a simpler way to
>> achieve it with one click on a batch or script
>>
>> Possible ?
>>
>> The dongle I use is an ASUS Wireless USB Network Adapter ( with Ralink
>> drivers)
>>
>> TIA

>
> Hard to say. Perhaps stopping, then restarting the service would be
> sufficient. With my own USB dongle the commands would be:
> @echo off
> net stop ANIWZCSdService
> net start ANIWZCSdService
>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      22nd Jan 2009
Here is a batch file that can enable/disable a device. You invoke it with a
parameter of "enable" or "disable".
@echo off
if /i "%1"=="enable" goto start
if /i "%1"=="disable" goto start
goto :eof

:Start
setlocal enabledelayedexpansion
set Desc=Name: USB Mass Storage Device
set HWID=x
set count=0
set found=no

devcon hwids "usb\vid*" > c:\usb.txt
for /F "tokens=*" %%* in (c:\usb.txt) do (
set /a count=!count! + 1
if /i "%%*"=="%Desc%" set found=yes& set count=1
if !found!==yes if !count!==4 set HWID=%%*
)
echo HWID=!HWID!
devcon %1 "!HWID!"
endlocal
del c:\usb.txt

By setting Desc=Name: USB Mass Storage Device in the batch file, it will
enable/disable a USB-connected disk. Your challenge is to find the
appropriate description for your wireless dongle. You can do it like so:
- Execute these commands from a Command Prompt:
devcon hwids "usb\vid*" > c:\usb.txt
notepad c:\usb.txt
- Look for an identifier for your dongle.

You can download devcon.exe from here:
http://download.microsoft.com/downlo...240/devcon.exe


"MoiMeme" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Ok for the service. That works.
>
> But most often I have to deactivate the dongle in hardware manager, the
> reactivate it .
>
> Can that be done as well ?
>
> ( Soory for direct reply ! was not intended so !)
>
> "Pegasus (MVP)" <(E-Mail Removed)> a écrit dans le message de news:
> %(E-Mail Removed)...
>>
>> "MoiMeme" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> Hi,
>>>
>>> have my USB Wireless dongle constatntly dropping ( although drivers ok
>>> and up-to-date, constantly awake etc)
>>>
>>> Have to deactivate it, re-activate it and start a services which it
>>> relies on to most often regain connetcion to the web.
>>>
>>> Doing theses maneuvers is tedious so I am looking for a simpler way to
>>> achieve it with one click on a batch or script
>>>
>>> Possible ?
>>>
>>> The dongle I use is an ASUS Wireless USB Network Adapter ( with Ralink
>>> drivers)
>>>
>>> TIA

>>
>> Hard to say. Perhaps stopping, then restarting the service would be
>> sufficient. With my own USB dongle the commands would be:
>> @echo off
>> net stop ANIWZCSdService
>> net start ANIWZCSdService
>>
>>

>
>



 
Reply With Quote
 
MoiMeme
Guest
Posts: n/a
 
      22nd Jan 2009

Thanks. That works fine !

Many thanks again.

"Pegasus (MVP)" <(E-Mail Removed)> a écrit dans le message de news:
e$(E-Mail Removed)...
> Here is a batch file that can enable/disable a device. You invoke it with
> a parameter of "enable" or "disable".
> @echo off
> if /i "%1"=="enable" goto start
> if /i "%1"=="disable" goto start
> goto :eof
>
> :Start
> setlocal enabledelayedexpansion
> set Desc=Name: USB Mass Storage Device
> set HWID=x
> set count=0
> set found=no
>
> devcon hwids "usb\vid*" > c:\usb.txt
> for /F "tokens=*" %%* in (c:\usb.txt) do (
> set /a count=!count! + 1
> if /i "%%*"=="%Desc%" set found=yes& set count=1
> if !found!==yes if !count!==4 set HWID=%%*
> )
> echo HWID=!HWID!
> devcon %1 "!HWID!"
> endlocal
> del c:\usb.txt
>
> By setting Desc=Name: USB Mass Storage Device in the batch file, it will
> enable/disable a USB-connected disk. Your challenge is to find the
> appropriate description for your wireless dongle. You can do it like so:
> - Execute these commands from a Command Prompt:
> devcon hwids "usb\vid*" > c:\usb.txt
> notepad c:\usb.txt
> - Look for an identifier for your dongle.
>
> You can download devcon.exe from here:
> http://download.microsoft.com/downlo...240/devcon.exe
>
>
> "MoiMeme" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Ok for the service. That works.
>>
>> But most often I have to deactivate the dongle in hardware manager, the
>> reactivate it .
>>
>> Can that be done as well ?
>>
>> ( Soory for direct reply ! was not intended so !)
>>
>> "Pegasus (MVP)" <(E-Mail Removed)> a écrit dans le message de news:
>> %(E-Mail Removed)...
>>>
>>> "MoiMeme" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> Hi,
>>>>
>>>> have my USB Wireless dongle constatntly dropping ( although drivers ok
>>>> and up-to-date, constantly awake etc)
>>>>
>>>> Have to deactivate it, re-activate it and start a services which it
>>>> relies on to most often regain connetcion to the web.
>>>>
>>>> Doing theses maneuvers is tedious so I am looking for a simpler way to
>>>> achieve it with one click on a batch or script
>>>>
>>>> Possible ?
>>>>
>>>> The dongle I use is an ASUS Wireless USB Network Adapter ( with Ralink
>>>> drivers)
>>>>
>>>> TIA
>>>
>>> Hard to say. Perhaps stopping, then restarting the service would be
>>> sufficient. With my own USB dongle the commands would be:
>>> @echo off
>>> net stop ANIWZCSdService
>>> net start ANIWZCSdService
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
After install msi and run command line to start the service greg chu Microsoft VB .NET 0 2nd May 2007 07:10 PM
NET START STOP Service Command Line Dr. Network Windows Vista General Discussion 3 27th Sep 2006 03:17 AM
command line (start a service) Russ Windows XP Help 2 24th Aug 2006 03:56 AM
Command Line for Service Install/Start/Stop/Uninstall DP Windows XP Help 1 16th Feb 2005 12:37 PM
Start service from command line Tony Thijs Microsoft Windows 2000 CMD Promt 13 28th Oct 2003 03:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:28 PM.