Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Win7 修改 USB 隨身碟圖標與右鍵選單:Autorun.inf 手寫教學

編輯:Windows 7 系統介紹

原理

USB 裝置插入時,Windows 讀取根目錄 Autorun.inf 決定圖標、標籤、右鍵選單項目、自動執行程式。純文字檔,可用記事本編輯。

語法格式

[AUTORUN]
ICON=圖標檔案路徑 (必須為 .ico,路徑相對於根目錄,如 icon.ico)
LABEL=磁碟機標籤名稱
; 右鍵選單自訂項目
shell\關鍵字=選單顯示文字
shell\關鍵字\Command=執行命令 (如 notepad.exe readme.txt)
; 自動執行
OPEN=自動執行程式 (如 setup.exe)

實作範例

[AUTORUN]
ICON=myusb.ico
LABEL=MyBackupDrive
shell\openfolder=開啟備份資料夾
shell\openfolder\Command=explorer.exe .
shell\viewreadme=閱讀說明
shell\viewreadme\Command=notepad.exe readme.txt

步驟

  1. 準備 .ico 圖標檔放入 USB 根目錄。
  2. 記事本編輯上述內容,存為 Autorun.inf (編碼 ANSI/UTF-8 均可) 放入根目錄。
  3. 重新插入 USB,圖標、標籤、右鍵選單即生效。

注意事項

  • Win7 預設關閉「自動執行」功能 (安全性考量),OPEN= 不會自動執行,但圖標/標籤/右鍵選單仍有效。
  • 部分防毒軟體會刪除/隔離 Autorun.inf,需加入信任清單。
  • 圖標檔建議 256x256、32 位元色深,相容性最佳。
Copyright © Windows教程網 All Rights Reserved