HP DesignJet Z6600 System Administrator s Guide - Page 36

set objFile =FSO.OpenTextFilestrInfPath, ForReading

Page 36 highlights

HP DJ UPD SAG 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 36

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

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)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''