USBD

Author: SKAN Last Modified: 20090602


With these functions usb flash drive hardware can be safely removed. No external program is needed.

USBD_DeviceEject( DeviceID )
USBD_GetDeviceID( Serial )
USBD_GetDeviceSerial( Drv="" )
USBD_SafelyRemove( Drv )

For more details of the functions's parameters and return value, please see it's source code.

Remarks

One of the functions *USBD_SafelyRemove()* requires at least WIN_VISTA, WIN_XP or WIN_2000.

There is no documentation. This one is handwritten by me.

Added manually the prefix USBD_ to DeviceEject() function, to make the library fully stdlib conform.

For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/viewtopic.php?t=44873

License

nonexistent

Example

; #Include USBD.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

; You may use a drive letter
USBD_SafelyRemove( "H:" )

; call DeviceEject() directly with a DeviceID
;USBD_DeviceEject( "USB\VID_058F&PID_6387\GDLL4HW4" )