Register dlls with VBScript
Created: 28 December 2005 Modified:Originally published on chrislynch.info website.
Below are two scripts which I used quite regularly for a while to register and unregister DLLs I created with VB to work with ASP Web Applications.
rd.vbs
Dim dllname, commandObj
Set commandObj = CreateObject("WScript.Shell")
dllname = InputBox("Enter in your dll file name")
commandObj.Run "c:\winnt\system32\regsvr32.exe d:\dlls\"&dllname,,true
commandObj.Run "net start iisadmin",,true
commandObj.Run "net start w3svc",,true
commandObj.Run "net start smtpsvc",,true
set commandObj = nothing
ud.vbs
Dim dllname, commandObj, fso, fileObj
Set commandObj = CreateObject("WScript.Shell")
dllname = InputBox("Enter in your dll file name")
commandObj.Run "kill -f inetinfo",,true
commandObj.Run "kill -f dllhost",,true
commandObj.Run "c:\winnt\system32\regsvr32.exe /u d:\dlls\"&dllname,,true
Set fso = CreateObject("Scripting.FileSystemObject")
set fileObj = fso.GetFile("d:\dlls\"&dllname)
fileObj.Delete(true)
set fileObj = nothing
set fso = nothing
set commandObj = nothing
tags: blog - old blog - Windows