> On Tue, 08 Nov 2011 23:27:45 +0100, Petr Laznovsky
> <
nob...@nowhere.com> wrote:
>
>> On 8.11.2011 0:36, Andy wrote:
>>> On Nov 7, 11:55 am,
t...@testnospam.nl wrote:
>>>> Is it possible to power off a device via a batch file?
>>>>
>>>> I have this USB microscope that, is turned on when I boot my Windows
>>>> XP PC.
>>>>
>>>> Is there a way to disable the power to that specific port so the LED's
>>>> in the microscope are dimmed?
>>>>
>>>> I have Devcon on my PC but when I try to disable the device it still
>>>> gets power (the LEDs keep burning).
>>>>
>>>> What I tought was to by default disable the power to the USB port, and
>>>> when I open the software for the microscope, enable the power back?
Caveat: I have not tested this.
Type this command:
devcon hwids USB\ROOT_HUB*|findstr "^USB"
It gives me a list like this for example on my machine:
USB\ROOT_HUB\4&14E368E2&0
USB\ROOT_HUB\4&22DCF096&0
USB\ROOT_HUB\4&25712375&0
USB\ROOT_HUB\4&2B98EF05&0
USB\ROOT_HUB\4&3AE06BE8&0
USB\ROOT_HUB\4&6427700&0
USB\ROOT_HUB20\4&1828FFF1&0
USB\ROOT_HUB20\4&5E0D3C3&0
Now use each line above that you find from your machine, in a command like this (with the first one from my machine as an example)
devcon disable "USB\ROOT_HUB\4&14E368E2&0"
and see if the Microscope LED goes out.
*If it doesn't then use the same command but replace disable with enable* to turn that port back on, like this example.
devcon enable "USB\ROOT_HUB\4&14E368E2&0"
Once you find the port that disables the microscope then you can put that command in a batch file to disable and enable it.
*BE AWARE* that during testing your USB mouse and keyboard and USB hubs and other USB devices may be disabled.
--
Regards,
Mic