HP DesignJet T795 System Administrator s Guide - Page 31

Appendix: Visual Basic Script

Page 31 highlights

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

  • 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
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