HP Designjet Universal Print Driver - System Administrator's Guide

HP DJ UPD SAG
38
objPrinter.Put_
msg = Err.Description
On Error GoTo 0
If msg <> "" Then
wscript.echo "Cannot share printer" & objPrinter.Name & ": " & msg
End If
End If
Next
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function read from external config file
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function ReadConfigValues(configSharing,configVerbosity,configDriverSubfolder,configPort)
Dim FSO, objFile, leng, leng2,StrConst,StrConstValue,strText,oArgs
Const ForReading = 1
Set FSO = CreateObject("Scripting.FileSystemObject")
set objFile =FSO.OpenTextFile("Config.cfg", ForReading)
Do Until objFile.AtEndOfStream
strText = objFile.Readline
if Left(strText,1) ="k" then
leng = InStr(strText,"=")
leng2 = len(strText) - leng
StrConstValue = Right(strText,leng2)
StrConst = Left(strText,leng-1)
select case StrConst
case "kSharing"
configSharing = StrConstValue
case "kVerbosity"
configVerbosity = StrConstValue
case "kDriverSubfolder"
configDriverSubfolder = StrConstValue
case "kPort"
set oArgs = wscript.Arguments
If oArgs.Count = 0 then
configPort = StrConstValue
end if
case else
exit function
end select
end if
Loop
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function checks that the local port is correct
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function CheckPortName(portName)
Dim pos, path, fso2
pos = InStrRev(portName, "\")
path = Left(portName, pos)
Set fso2 = CreateObject("Scripting.FileSystemObject")
if Not fso2.FolderExists(path) then