

dim oPort
dim oMaster

dim strDllPath
dim strPortName
dim strHostAddress

strDllPath = Wscript.Arguments(0)
strDllPath = """" & strDllPath & """"

strPortName = Wscript.Arguments(1)
strHostAddress = Wscript.Arguments(2)

Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Run "regsvr32 /s " & strDllPath, 1, TRUE

set oPort   = CreateObject("Port.Port.1")
set oMaster = CreateObject("PrintMaster.PrintMaster.1")

oMaster.PortGet "", strPortName, oPort

oPort.HostAddress=strHostAddress

oMaster.PortSet oPort

WshShell.Run "regsvr32 /s /u " & strDllPath, 1, TRUE

set oPort=Nothing
set oMaster=Nothing


