Windows 為安全預設關閉 U盤 自動播放(AutoRun),但若您信任特定 U盤 並需插入即執行程式(如便攜版軟體、備份腳本、簡報自動播放),可透過以下兩種方式重新啟用。
在 U盤 **根目錄** 建立 autorun.inf 純文字檔,內容如下:
setup.exe)[AutoRun]
open=setup.exe
shellexecute=setup.exe
shell\Auto\command=setup.exe
icon=setup.exe,0
label=MyUSB
App\launcher.exe)[AutoRun]
open=App\launcher.exe
shellexecute=App\launcher.exe
shell\Auto\command=App\launcher.exe
icon=App\launcher.exe,0
label=MyUSB
參數說明:
- open:雙擊磁碟機圖示/自動播放時執行的指令。
- shellexecute:支援 URL/文件關聯(如 shellexecute=readme.pdf 會用關聯程式開啟)。
- shell\Auto\command:右鍵選單「自動播放」項目對應指令。
- icon:磁碟機圖示來源(exe 內第 0 個圖示或 .ico 檔)。
- label:資源管理器顯示的磁碟機標籤名稱。
autorun.inf(病毒常利用此機制傳播)。autorun.inf(企業環境)。autorun.inf 型蠕蟲病毒(如 Conficker/Downadup 變種)。AutoRun 是雙面刃:用得好是自動化利器,用不好是病毒高速公路。清楚風險、限制範圍、配合加密,才能安心享受便利。