【轉貼】USB 儲存裝置(隨身碟, 外接式硬碟)自動執行 Autorun



贊助商連結


FYI
2007-02-12, 07:45 AM
USB Storage - FAQ for Driver and Hardware Developers (http://www.microsoft.com/taiwan/whdc/device/storage/usbfaq.mspx)

Q: What must I do to trigger Autorun on my USB storage device?
The Autorun capabilities are restricted to CD-ROM drives and fixed disk drives. If you need to make a USB storage device perform Autorun, the device must not be marked as a removable media device and the device must contain an Autorun.inf file and a startup application.

The removable media device setting is a flag contained within the SCSI Inquiry Data response to the SCSI Inquiry command. Bit 7 of byte 1 (indexed from 0) is the Removable Media Bit (RMB). A RMB set to zero indicates that the device is not a removable media device. A RMB of one indicates that the device is a removable media device. Drivers obtain this information by using the StorageDeviceProperty request.
不同的Windows 版本似乎對 "卸除式(DRIVE_REMOVABLE)" 裝置有不同的處理, 如僅就WinXP 來說, WinXP 不支援卸除式裝置的自動執行, 其中包含了絕大多數的USB 讀卡機和隨身碟, 這是和韌體設計有關, 解決的方法是安裝第三方軟件, 例如APO USB Autorun (http://www.archidune.com/?q=node/4) 或者購買包含附加功能的USB 隨身碟, 例如U3 (http://www.u3.com/) 的U3 Smart Drive

另外要注意的是, 一旦USB 儲存裝置能夠自動執行(例如USB 外接式硬碟), 那麼拔除前最好能 "安全地移除硬體", 因為固定式和卸除式磁碟機的差異之一就是寫入快取, Windows XP 預設為固定式磁碟機啟用寫入快取, 如果未經正常卸除, 則可能會造成資料遺失

Tips for USB pen drives (http://www.uwe-sieber.de/usbstick_e.html)
Troubleshooting for USB pen drives under Windows XP (http://www.uwe-sieber.de/usbtrouble_e.html)

卸除式與 USB 儲存裝置 (http://www.microsoft.com/taiwan/whdc/device/storage/rem-stor.mspx)
Enabling and Disabling AutoRun (http://msdn.microsoft.com/en-us/library/bb776825.aspx)
Using and Configuring AutoPlay (http://msdn.microsoft.com/en-us/library/bb776829(VS.85).aspx)
Preparing Hardware and Software for Use with AutoPlay (http://msdn.microsoft.com/en-us/library/bb776827.aspx)
NoDriveTypeAutoRun (http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/91525.mspx)
NoDriveAutoRun (http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/93506.mspx)
CDROM Autorun (http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/30300.mspx)
CDROM AutoRunAlwaysDisable (http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/58493.mspx)