NicePerson Posted July 9, 2010 Posted July 9, 2010 How to register a dll file with AutoIt? For Example: regsvr32 %windir%\system32\zipfldr.dll
PsaltyDS Posted July 9, 2010 Posted July 9, 2010 Opt("ExpandEnvStrings", 1) Run("regsvr32 %windir%\system32\zipfldr.dll") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
trancexx Posted July 9, 2010 Posted July 9, 2010 If you want to do that the way it should be done considering the language it would be: expandcollapse popup#RequireAdmin ; Unregister If _UnregisterServer("zipfldr.dll") Then MsgBox(64, "zipfldr.dll OK", "DllUnregisterServer succeeded!") Else If @error = 1 Then MsgBox(48, "zipfldr.dll Error", "DllUnregisterServer failed with error code 0x" & Hex(@extended)) Else MsgBox(48, "zipfldr.dll Error", "zipfldr.dll missing maybe?") EndIf EndIf ; Register If _RegisterServer("zipfldr.dll") Then MsgBox(64, "zipfldr.dll OK", "DllRegisterServer succeeded!") Else If @error = 1 Then MsgBox(48, "zipfldr.dll Error", "DllRegisterServer failed with error code 0x" & Hex(@extended)) Else MsgBox(48, "zipfldr.dll Error", "zipfldr.dll missing maybe?") EndIf EndIf ; Functions... Func _RegisterServer($sDll) Local $fInit, $fError Local $aCall = DllCall("ole32.dll", "long", "OleInitialize", "ptr", 0) If Not @error Then $fInit = $aCall[0] <> 1 ; The COM library is already initialized $aCall = DllCall($sDll, "long", "DllRegisterServer") If @error Then $fError = True If $fInit Then DllCall("ole32.dll", "none", "OleUninitialize") If $fError Then Return SetError(2, 0, False) Return SetError($aCall[0] <> 0, $aCall[0], $aCall[0] = 0) EndFunc Func _UnregisterServer($sDll) Local $fInit, $fError Local $aCall = DllCall("ole32.dll", "long", "OleInitialize", "ptr", 0) If Not @error Then $fInit = $aCall[0] <> 1 ; The COM library is already initialized $aCall = DllCall($sDll, "long", "DllUnregisterServer") If @error Then $fError = True If $fInit Then DllCall("ole32.dll", "none", "OleUninitialize") If $fError Then Return SetError(2, 0, False) Return SetError($aCall[0] <> 0, $aCall[0], $aCall[0] = 0) EndFunc ioa747 1 ♡♡♡ . eMyvnE
NinjaDuck Posted February 28, 2013 Posted February 28, 2013 (edited) What if the equivalent regsvr32.exe cmd line also calls DLLInstall or DLLUninstall (that is, there's a /i or /i:{command} on the regsvr32 cmdline) Is that a nested autoit DLLCall or a separate one? Usage: regsvr32 [/n] [/i[:cmdline]] dllname /u - Unregister server /s - Silent; display no message boxes /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 Edited February 28, 2013 by Melba23 Enlarged font
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now