Jump to content
Sign in to follow this  
AlexS

Monitoring USB

Recommended Posts

AlexS

Hi forum,

I'm wondering if there's a way for AutoIT to monitor connected USB devices, and either stop one from being removed or by reconnecting it after it has been disconnected.

I have an internal card reader that is connected through the internal USB, so the only way to reconnect the device physically after removing it through the "Safely Remove Hardware" dialog is to restart the computer or open the thing up and disconnect it. It would be nice to have it be reconnected any time myself or someone else disconnects it this way.

Thanks in advance!

Share this post


Link to post
Share on other sites
UltraFine

Hi forum,

I'm wondering if there's a way for AutoIT to monitor connected USB devices, and either stop one from being removed or by reconnecting it after it has been disconnected.

I have an internal card reader that is connected through the internal USB, so the only way to reconnect the device physically after removing it through the "Safely Remove Hardware" dialog is to restart the computer or open the thing up and disconnect it. It would be nice to have it be reconnected any time myself or someone else disconnects it this way.

Thanks in advance!

can you read the help file for DriveGetDrive() , While...WEnd , For...Next , DriveGetStatus() ?

Share this post


Link to post
Share on other sites
AlexS

can you read the help file for DriveGetDrive() , While...WEnd , For...Next , DriveGetStatus() ?

Ok, this will help me find my drives when they are connected. These will not help me change a device from "ready to be removed" state back to "ready" state though. Any other suggestions?

Share this post


Link to post
Share on other sites
UltraFine

Ok, this will help me find my drives when they are connected. These will not help me change a device from "ready to be removed" state back to "ready" state though. Any other suggestions?

search the forum for dismount, Eject, USB, etc

also there is a good example by rasim for USB scripts in example scripts.

did you see DriveGetStatus() ? please explain more what you are trying to do.

Edited by L0veUK

Share this post


Link to post
Share on other sites
spudw2k

search the forum for dismount, Eject, USB, etc

also there is a good example by rasim for USB scripts in example scripts.

did you see DriveGetStatus() ? please explain more what you are trying to do.

I think he's trying to solve the age old question of "how do I remount a removed disk drive usb device without unpluggin and plugging it back in." So far no has achieved this yet Alex. 'Bout the only way I've found (which by no means is elegant) is to uninstall USB Controller and then Scan for Hardware changes to reinstall it. This also works if you remove just the USB device, but only if the device was NOT "safely removed".

Slightly more elegant (not much) is to simply disable the USB controller(s) and re-enable them. :mellow:

Edited by spudw2k

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.