執行 regsvr32 xxx.ocx/dll 時出現 「DllRegisterServer 呼叫失敗」,絕大多數是權限不足(非管理員身分)或路徑/架構不符(32/64 位元混淆)。


regsvr32 "C:\Windows\SysWOW64\comdlg32.ocx"


regsvr32 "C:\Windows\System32\comdlg32.ocx"
# 或直接檔名(若在 PATH 中)
regsvr32 COMDLG32.OCX

| 系統架構 | 32位元元件實際路徑 | 64位元元件實際路徑 |
|---|---|---|
| 64 位元 Windows | C:\Windows\SysWOW64\ | C:\Windows\System32\ |
| 32 位元 Windows | C:\Windows\System32\ | 不適用 |
SysWOW64 = Windows 32-bit on Windows 64-bit,專門存放 32 位元系統元件;System32 在 64 位元系統實際存放 64 位元元件。務必對應正確路徑。
sfc /scannow 修復系統檔案。指令執行後彈出 「DllRegisterServer 在 xxx.ocx 成功」 訊息即代表成功。可在登錄表 HKEY_CLASSES_ROOT\CLSID\{...} 搜尋對應 CLSID 確認。