Wednesday 11 March 2015

Register a DLL through VBScript - Advance Application Packaging


Below piece of code can be used to register a DLL.
EAL.dll  & erxml.dll are two DLL are registered from ProgramFiles(x86) location

Option Explicit
On Error Resume Next

Dim oShell

Dim StrOSType,strPath

set oShell = CreateObject("Wscript.Shell")

strPath=oShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")

objshell.run "regsvr32.exe /s %programfiles(x86)%\CA\AllFusion ERwin Data Modeler r7\EAL.dll"

objshell.run "regsvr32.exe /s %programfiles(x86)%\CA\AllFusion ERwin Data Modeler r7\erxml.dll"

Set oShell = nothing



Below piece of code can be used to unregister a DLL
EAL.dll  & erxml.dll are two DLL are unregistered from ProgramFiles(x86) location

Option Explicit
On Error Resume Next

Dim oShell

Dim StrOSType,strPath

set oShell = CreateObject("Wscript.Shell")

strPath=oShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")

oShell.Run "cmd /C regsvr32 /u /s "& chr(34) & strPath &"\CA\AllFusion ERwin Data Modeler r7\EAL.dll"& chr(34),0,True

oShell.Run "cmd /C regsvr32 /u /s "& chr(34) & strPath &"\CA\AllFusion ERwin Data Modeler r7\erxml.dll"& ch(34),0,True


Set oShell = nothing


Thank you for reading.

1 comment: