HP Designjet Universal Print Driver - System Administrator's Guide

HP DJ UPD SAG
39
wscript.echo "The Folder "+ path +"does not exist."
wscript.echo "Installation not done"
wscript.quit(1)
end if
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function verifies if the local port given by the user
' already exists
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function PortExists(portName)
const HKEY_LOCAL_MACHINE = &H80000002
dim strKeyPath, oReg, arrValueNames, arrValueTypes, i, found
found = false
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports"
oReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes
For i=0 To UBound(arrValueNames)
if arrValueNames(i) = portName then
found = true
exit for
end if
Next
PortExists = found
end function
Function Ping (hostAddress)
Dim colPingResults, objPingResult, strQuery, respond
respond = False
' Define the WMI query
strQuery = "SELECT * FROM Win32_PingStatus WHERE Address = '" & hostAddress & "'"
' Run the WMI query
Set colPingResults = GetObject("winmgmts://./root/cimv2").ExecQuery( strQuery )
' Translate the query results to either True or False
For Each objPingResult In colPingResults
If Not IsObject( objPingResult ) Then
respond = False
ElseIf objPingResult.StatusCode = 0 Then
respond = True
Else
respond = False
End If
Next
Ping = respond
Set colPingResults = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function displays help message
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub ShowHelp()