HP Designjet Universal Print Driver - System Administrator's Guide

HP DJ UPD SAG
36
infFile = subpath + aItem.Name
found = true
exit for
end if
Next
end if
GetInfFile = found
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function read the inf file to obtain information about driver
' Input Params:
' - strInfPath: The INF full path file
' Output Parms:
' - printer: The name of the printer
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function ReadInf(strInfPath, printer)
Dim FSO, objFile, printerSectionFound, leng, line
Const ForReading = 1
printerSectionFound = 0
Set FSO = CreateObject("Scripting.FileSystemObject")
set objFile =FSO.OpenTextFile(strInfPath, ForReading)
Do Until objFile.AtEndOfStream
line = objFile.Readline
if printerSectionFound = 1 and Left(line,1) = """" then
'Getting first quoted text ("")
leng = len(line)
leng = leng - 1
line = Right(line,leng)
leng = instr(line,"""")
leng = leng - 1
printer = Left(line , leng)
exit function
end if
if line = "[HP.NTAMD64]" or line = "[HP]" then
printerSectionFound = 1
end if
Loop
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function checks if printer name already exists. If it exists, it will return a new
' name with the format printerName(Copy x). If it does not exists, the name passed will not get modified
' Input Params:
' - printerName: The name of the printer to install
' Output Parms:
' - printerName: The name of the printer with no duplicates (copy x)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''