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

Windows 系統 Regsvr32 完整參數詳解與 ActiveX 手動註冊實戰

編輯:XP 系統應用技巧

Regsvr32.exe 位於 %SystemRoot%\System32\,專責 ActiveX/COM 元件 (`.dll`、`.ocx`) 註冊與反註冊。

語法

regsvr32 [/u] [/s] [/i[:cmdline]] [/n] DLL名稱

參數詳細說明

參數功能
/u反註冊 (移除登錄檔項目)
/s靜默模式,成功/失敗皆不彈出對話框,適合批次腳本
/i[:cmdline]呼叫 DllInstall 進行安裝,可傳遞命令列參數;若未註冊則同時註冊
/n搭配 /i 使用,僅執行安裝不進行註冊
/c主控台輸出模式 (較新版本支援)

實戰範例

  • 註冊:regsvr32 myshell.dll
  • 靜默註冊:regsvr32 /s myshell.dll
  • 反註冊:regsvr32 /u myshell.dll
  • 安裝並註冊:regsvr32 /i myshell.dll
  • 僅安裝:regsvr32 /i /n myshell.dll

建議將元件複製至 System32 再註冊,避免路徑問題。64 位系統註冊 32 位元件請用 %SystemRoot%\SysWOW64\regsvr32.exe。

Copyright © Windows教程網 All Rights Reserved