----- Original Message ----- From: "Paul Moore" <[EMAIL PROTECTED]> To: "Tim Golden" <[EMAIL PROTECTED]> Cc: <python-win32@python.org> Sent: Monday, January 16, 2006 12:20 PM Subject: Re: [python-win32] Dismounting a USB flash drive
> On 1/13/06, Tim Golden <[EMAIL PROTECTED]> wrote: > > Well, according to this message: > > > > http://groups.google.com/group/microsoft.public.win32.programmer.wmi/msg/799622aef19f9a3c > > > > it's not supported in WMI. Which is a shame because > > it would be quite useful. Maybe someone more win32 > > API-oriented might have some idea. > > Tim, > Thanks for looking into this. I found a command line program (devcon, > available from MS Knowledge Base article 311272 - > http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272) which > allows you to disable/remove/etc USB devices. But a few experiments > made me realise that there's more to it than a simple "unplug" command > - I managed to get all sorts of odd effects (drive "ejected" but still > "plugged", through to the driver reinstalling itself when I inserted > the drive again). I suspect that it's too easy to get things in a > nasty state. > > So I'm sticking with a manual click on the tray icon, as the only way > I'm not scared of, for now :-) > > Thanks for the help in any case, > Paul. I was pleasantly surprised to find that the source code for devcon.exe is included with the Windows DDK. Turns out it uses the SetupDI* functions from SetupApi.h. They look to be fairly involved for creating a python interface. Roger _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32