HP DesignJet Z6800 System Administrator s Guide - Page 39
strKeyPath = SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports
View all HP DesignJet Z6800 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 39 highlights
HP DJ UPD SAG 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() 39