【轉貼】USB 儲存裝置(隨身碟, 外接式硬碟)自動執行 Autorun
[URL="http://www.microsoft.com/taiwan/whdc/device/storage/usbfaq.mspx"]USB Storage - FAQ for Driver and Hardware Developers[/URL]
[INDENT]Q: What must I do to trigger Autorun on my USB storage device?
The Autorun capabilities are restricted to [B]CD-ROM drives[/B] and [B]fixed disk drives[/B]. If you need to make a USB storage device perform Autorun, the device must not be marked as a [B]removable media device[/B] 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.[/INDENT]
不同的Windows 版本似乎對 "[B]卸除式(DRIVE_REMOVABLE)[/B]" 裝置有不同的處理, 如僅就[B]WinXP[/B] 來說, WinXP 不支援卸除式裝置的自動執行, 其中包含了絕大多數的USB 讀卡機和隨身碟, 這是和韌體設計有關, 解決的方法是安裝第三方軟件, 例如[URL="http://www.archidune.com/?q=node/4"]APO USB Autorun[/URL] 或者購買包含附加功能的USB 隨身碟, 例如[URL="http://www.u3.com/"]U3[/URL] 的U3 Smart Drive
另外要注意的是, 一旦USB 儲存裝置能夠自動執行(例如USB 外接式[B]硬碟[/B]), 那麼拔除前最好能 "[B]安全地移除硬體[/B]", 因為固定式和卸除式磁碟機的差異之一就是寫入快取, Windows XP 預設為固定式磁碟機啟用[B]寫入快取[/B], 如果未經正常卸除, 則可能會造成資料遺失
[URL="http://www.uwe-sieber.de/usbstick_e.html"]Tips for USB pen drives[/URL]
[URL="http://www.uwe-sieber.de/usbtrouble_e.html"]Troubleshooting for USB pen drives under Windows XP[/URL]
[URL="http://www.microsoft.com/taiwan/whdc/device/storage/rem-stor.mspx"]卸除式與 USB 儲存裝置[/URL]
[URL="http://msdn.microsoft.com/en-us/library/bb776825.aspx"]Enabling and Disabling AutoRun[/URL]
[URL="http://msdn.microsoft.com/en-us/library/bb776829(VS.85).aspx"]Using and Configuring AutoPlay[/URL]
[URL="http://msdn.microsoft.com/en-us/library/bb776827.aspx"]Preparing Hardware and Software for Use with AutoPlay[/URL]
[URL="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/91525.mspx"]NoDriveTypeAutoRun[/URL]
[URL="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/93506.mspx"]NoDriveAutoRun[/URL]
[URL="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/30300.mspx"]CDROM Autorun[/URL]
[URL="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/58493.mspx"]CDROM AutoRunAlwaysDisable[/URL]