欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

DLL(OCX)文件注冊(cè)與反注冊(cè)方法(regsvr32用法)

  發(fā)布時(shí)間:2012-12-16 16:17:22   作者:佚名   我要評(píng)論
很多朋友從腳本之家下載了dll文件,但不會(huì)安裝,這里分享下解決方法,需要的朋友可以參考下
注冊(cè)DLL與反注冊(cè)DLL文件的方法

如果經(jīng)常需要注冊(cè)與反注冊(cè)dll可以用注冊(cè)表文件

復(fù)制代碼
代碼如下:

[HKEY_CLASSES_ROOT\dllfile\shell\Unregister]
"Command"="regsvr32 %1 /u"
[HKEY_CLASSES_ROOT\dllfile\shell\Register]
"Command"="regsvr32 %1"

當(dāng)我們需要注冊(cè)或者反注冊(cè)dll時(shí),只要在該dll文件上按下鼠標(biāo)右鍵即可!

由于下面的方法太過啰嗦,這里簡(jiǎn)單的說下,注冊(cè)dll

一般情況下,為了經(jīng)常使用,建議將dll復(fù)制到系統(tǒng)盤的windows/system32目錄,如果不是的,有時(shí)候需要加上dll的完整路徑
注冊(cè)dll

復(fù)制代碼
代碼如下:

regsvr32 /s winshow.dll

反注冊(cè)dll

復(fù)制代碼
代碼如下:

regsvr32 /u winshow.dll


ocx 控件注冊(cè)方法

ocx 控件的安裝方式有很多種,這里介紹最簡(jiǎn)單的一種。
OCX 控件文件復(fù)制到某個(gè)目錄

步驟:

1.將需要安裝的目錄,例如 C 盤根目錄下。
2.進(jìn)入開始菜單,點(diǎn)擊“運(yùn)行”
3.在出現(xiàn)的框中鍵入regsvr32 C:/xxxx.ocx 。(XXXX 為 控件名,C:/為目錄)
4.點(diǎn)擊確認(rèn)后等待出現(xiàn)提醒注冊(cè)成功即可。

如果是偶爾一個(gè)軟件使用,將這個(gè)ocx文件復(fù)制到軟件目錄即可。

反注冊(cè)DLL大法
UnRegister DLLs
You can use the Regsvr32 tool (Regsvr32.exe) to register and unregister object linking and
embedding (OLE) controls such as dynamic-link library (DLL) or ActiveX Controls (OCX) files
that are self-registerable.

RegSvr32.exe has the following command-line options:
Regsvr32 [/n] [/i[:cmdline]] dllname
/u - Unregister server
/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll
uninstall
/n - do not call DllRegisterServer; this option must be used with /i
When you use Regsvr32.exe, it attempts to load the component and call its DLLSelfRegister
function. If this attempt is successful, Regsvr32.exe displays a dialog indicating success.
If the attempt is unsuccessful, Regsvr32.exe returns an error message, which may include a
Win32 error code.
Example: To unregister Winshow's winshow.dll:
Click the Start button, and select Run
Enter this command line:
regsvr32 /u [systemroot]\winshow.dll
For example, in a Windows XP machine in which your systemroot was at c:\winnt, you would
enter:
regsvr32 /u c:\winnt\winshow.dll
你能構(gòu)使用Regsvr32工具Regsvr32.exe注冊(cè)和反注冊(cè)目標(biāo)鏈接和深層OLE控制器類似于自動(dòng)注冊(cè)的動(dòng)態(tài)鏈接庫(DLL)和ActiveX控件。
(OCX)文件。
Regsvr32命令行參數(shù):
格式:Regsvr32 [/n] [/i[:cmdline命令行]] dllnamedll文件名
/u - Unregister server反注冊(cè)服務(wù)
/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll
uninstall
/i 通過此DLL的可選參數(shù),調(diào)用DLL安裝,反安裝使用/u
/n - do not call DllRegisterServer; this option must be used with /i
不調(diào)用DLL注冊(cè)服務(wù),此選項(xiàng)必須和/i一起使用
當(dāng)你使用Regsvr32.exe,它會(huì)嘗試載入DLL內(nèi)組件并且調(diào)用本身的自注冊(cè)功能。如果嘗試成功,Regsvr32.exe顯示一個(gè)成功提示框,如果嘗試失敗,Regsvr32.exe會(huì)返回一個(gè)錯(cuò)誤消息,一般會(huì)包含Win32錯(cuò)誤代碼(特征碼)。

例如

反注冊(cè)Windows的windows.dll文件

1、點(diǎn)擊“開始”按鈕,選擇“運(yùn)行”
2、輸入如下的命令行:
regsvr32 /u [systemroot系統(tǒng)目錄]\winshow.dll
注:卸載DLL時(shí),目錄為此DLL文件所在完整的最后打開的目錄

如:在系統(tǒng)目錄是c:\winnt的Windows XP操作系統(tǒng)中,你可以輸入如下命令行:
regsvr32 /u c:\winnt\winshow.dll
注意:一般來說,只有在無法刪除某些注冊(cè)過的DLL文件時(shí),才使用Regsvr32.exe反注冊(cè)此DLL

使用過activex的人都知道,activex不注冊(cè)是不能夠被系統(tǒng)識(shí)別和使用的,一般安裝程序都會(huì)自動(dòng)地把它所使用的activex控件注冊(cè),但如果你拿到的一個(gè)控件需要手動(dòng)注冊(cè)怎么辦呢?如果修改注冊(cè)表那就太麻煩了,在windows的system文件夾下有一個(gè)regsvr32.exe的程序,它就是windows自帶的activex注冊(cè)和反注冊(cè)工具。

一、regsvr32的用法為:

“regsvr32 [/s] [/n] [/i(:cmdline)] dllname”。其中dllname為activex控件文件名,建議在安裝前拷貝到system文件夾下。
參數(shù)有如下意義:
/u——反注冊(cè)控件
/s——不管注冊(cè)成功與否,均不顯示提示框
/c——控制臺(tái)輸出
/i——跳過控件的選項(xiàng)進(jìn)行安裝(與注冊(cè)不同)
/n——不注冊(cè)控件,此選項(xiàng)必須與/i選項(xiàng)一起使用
執(zhí)行該命令的方法:
1、可以在“開始”--“運(yùn)行”,調(diào)出運(yùn)行的對(duì)話框,也可以使用Win+R熱鍵,然后直接在輸入欄輸入即可
2、在開始--運(yùn)行 輸入cmd,調(diào)出‘命令提示符’窗口,然后再執(zhí)行regsvr32命令。

二、Regsvr32錯(cuò)誤消息的說明

當(dāng)使用 Regsvr32.exe 時(shí),它會(huì)嘗試加載該組件并調(diào)用它的 DLLSelfRegister 函數(shù)。如果此嘗試成功,Regsvr32.exe 會(huì)顯示一個(gè)指示成功的對(duì)話框。如果此嘗試失敗,Regsvr32.exe 會(huì)返回一條錯(cuò)誤消息,其中可能會(huì)包括一個(gè) Win32 錯(cuò)誤代碼。
以下列表介紹了 RegSvr32 錯(cuò)誤消息和可能的原因。
Unrecognized flag:/invalid_flag
鍵入的標(biāo)志或開關(guān)組合無效(請(qǐng)參閱本文中的“Regsvr32.exe 的用法”一節(jié))。
No DLL name specified.
未包括 .dll 文件名(請(qǐng)參閱本文中的“Regsvr32.exe 的用法”一節(jié))。
Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.
Dllname 不是 .dll 或 .ocx 文件。例如,鍵入 regsvr32 wjview.exe 就會(huì)生成該錯(cuò)誤消息。
Dllname is not an executable file and no registration helper is registered for this file type.
Dllname 不是可執(zhí)行文件(.exe、.dll 或 .ocx)。例如,鍵入 regsvr32 autoexec.bat 就會(huì)生成該錯(cuò)誤消息。
Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.
Dllname 可能未導(dǎo)出,或者內(nèi)存中可能有損壞的 Dllname 版本。請(qǐng)考慮使用 Pview 來檢測(cè)該文件并刪除它。
Dllname is not self-registerable or a corrupted version is in memory.
例如,鍵入 regsvr32 icwdial.dll 后就會(huì)返回該錯(cuò)誤消息,因?yàn)?Icwdial.dll 文件不能自行注冊(cè)。
如果您懷疑內(nèi)存中有損壞的 Dllname 版本,請(qǐng)嘗試重新啟動(dòng)計(jì)算機(jī),或重新提取該文件的原始版本。
如果您運(yùn)行的是 Windows NT,可能需要使用 Microsoft Windows NT Server 4.0 資源工具包 中的 Kill 或 Pview 工具。有關(guān)其他信息,請(qǐng)單擊以查看以下 Microsoft 知識(shí)庫文章: 197155 如何終止孤立進(jìn)程
OleInitialize failed (or OleUninitialize failed).
Regsvr32 必須先初始化 COM 庫,然后才能調(diào)用所需的 COM 庫函數(shù)并在關(guān)閉時(shí)撤消對(duì)該庫的初始化。
如果對(duì) COM 庫進(jìn)行初始化或撤消初始化的嘗試失敗,就會(huì)出現(xiàn)這些錯(cuò)誤消息。例如,Ole32.dll 文件
可能已經(jīng)損壞,或者其版本有誤。
LoadLibrary("Dllname") failed.GetlastError returns 0x00000485
在 Winerror.h 中,0x00000485 = 1157 (ERROR_DLL_NOT_FOUND),表示“找不到運(yùn)行該應(yīng)用程序所需的某個(gè)庫文件”。例如,鍵入 regsvr32 missing.dll 后,如果找不到 Missing.dll 文件,就會(huì)返回該錯(cuò)誤消息。
LoadLibrary("Dllname") failed.GetLastError returns 0x00000002
在 Winerror.h 中,0x00000002 = 2 (ERROR_FILE_NOT_FOUND),表示“系統(tǒng)找不到指定的文件”。換言之,系統(tǒng)找不到相關(guān)的 DLL。例如,如果鍵入 regsvr32 icwdial.dll,而此時(shí)缺少 Tapi32.dll(依賴項(xiàng)),就會(huì)返回該錯(cuò)誤消息。
LoadLibrary("dskmaint.dll") failed.GetLastError returns 0x000001f 在 Winerror.h 中,0x000001f = 31 (ERROR_GEN_FAILURE),表示“附加到系統(tǒng)上的設(shè)備不能正常工作”。如果您嘗試注冊(cè) Win16 .dll 文件,就會(huì)發(fā)生此現(xiàn)象。例如,鍵入 regsvr32 dskmaint.dll 會(huì)返回該錯(cuò)誤消息。
DllRegisterServer (or DllUnregisterServer)in Dllname failed.返回代碼是:字符串
在 Winerror.h 中搜索字符串。
Regsvr32.exe 和依賴項(xiàng)
RegSvr32.exe 依賴于 Kernel32.dll、User32.dll 和 Ole32.dll 文件(在 Windows NT 中,還依賴于 Msvcrt.dll 和 Advapi32.dll 文件)。Regsvr32.exe 會(huì)加載您嘗試注冊(cè)或撤消注冊(cè)的文件及其所有依賴項(xiàng)。如果缺少必需的文件或者它們已損壞,該進(jìn)程可能會(huì)失敗。
您可以使用 Depends.exe 來確定您嘗試注冊(cè)或撤消注冊(cè)的文件的依賴項(xiàng)。在 Microsoft Windows 98 資源工具包 和 Microsoft Windows NT 4.0 資源工具包 支持工具中都提供了 Depends.exe。
247024 Tools Included with the Microsoft Windows 98 Resource Kit

三、一個(gè)快速注冊(cè) DLL 及 OCX 的方法

注意看羅!方法如下:
1、在資源管理器中找到 C:\Windows\System\Regsvr32.exe 并【復(fù)制】 ( 按鼠標(biāo)右鍵選復(fù)制 )
2、將目錄移到 C:\Windows\SendTo 后,執(zhí)行【貼上快捷方式】 ( 按鼠標(biāo)右鍵選貼上快捷方式 )
3、將快捷方式名稱改成【REGISTER】
4、OK
現(xiàn)在,如果您想替某一個(gè)文件做注冊(cè)動(dòng)作,例如:C:\Windows\System\Test.ocx,您只要打開資源管理器,找到 C:\Windows\System\Test.ocx,按鼠標(biāo)右鍵選【傳送到】【REGISTER】即可完成注冊(cè)動(dòng)作了!
注:有一個(gè)地方要注意的是,Regsvr32.exe 只能注冊(cè) 32 位的文件!如果要用它來注冊(cè) 16 位的文件,會(huì)有錯(cuò)誤訊息產(chǎn)生。

相關(guān)文章

最新評(píng)論