HP Designjet Universal Print Driver - System Administrator's Guide

HP DJ UPD SAG
31
Appendix: Visual Basic Script
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' HP_DJ_UPD_install command line script
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
option explicit
'Main program
Main
Sub main
Dim hostAddress, infFile, path, printer, platform, driverName, portName, local
'Variables to read configuration settings from config.cfg
Dim configVerbosity, configSharing, configDriverSubfolder
'Read config settings from config.cfg
ReadConfigValues configSharing, configVerbosity, configDriverSubfolder, portName
if configVerbosity = 1 then
wscript.echo "Sharing = " + configSharing
end if
'Get the computer platform (x64 or x86)
GetPlatform platform
if configVerbosity = 1 then
wscript.echo "Platform = " + platform
end if
'Parse command line arguments
ParseCommandLine hostAddress, path, local, portName
if local = 0 then
portName = "HPDSJUPDPort_" + hostAddress
end if
if Not (Ping(hostAddress)) and configVerbosity = 1 then
wscript.echo "IP or Hostname " + hostAddress +" unreacheable. There may be some delay with the
installation"
end if
if configVerbosity = 1 then
wscript.echo "IP or Hostname = " + hostAddress
wscript.echo "Inf path = " + path
wscript.echo "Port name = " + portName
end if
'Get the inf file from path
if Not (GetInfFile(path, platform, configDriverSubfolder, infFile)) then
wscript.echo "No inf found in " + path
wscript.echo "Installation not done"
wscript.quit(1)
end if
if configVerbosity = 1 then
wscript.echo "Inf file = " + infFile
end if