HP DesignJet T3500 System Administrator s Guide - Page 35

For Each aItem In objDir.Files

Page 35 highlights

end function This function recovers information from Driver instalation path ' Input Params: ' - path: The Path of the instalation files ' Output Parms: ' - infFile: The INF full path file function GetInfFile(path,platform,configDriverSubfolder,infFile) Dim FSO, objDir, aItem, found, subpath Dim WshShell found = false if path "" then path = path + "\" else Set WshShell = WScript.CreateObject("WScript.Shell") path = wshshell.currentdirectory + "\" + configDriverSubfolder + "\" end if Set FSO = CreateObject("Scripting.FileSystemObject") if Not FSO.FolderExists(path) then wscript.echo "Folder does not exist" wscript.echo "Installation not done" wscript.quit(1) end if Set objDir = FSO.GetFolder(path) For Each aItem In objDir.Files If LCase(Right(Cstr(aItem.Name), 3)) = "inf" Then infFile = path + aItem.Name found = true exit for end if Next if found = false then ' path does not contain inf. Let's add x86 and x64 subfolders if platform = "x86" then subpath = path + "win2k_xp_vista\" else subpath = path + "winxp_vista_x64\" end if if Not FSO.FolderExists(subpath) then wscript.echo "No inf found either in " + path + " or in " + subpath wscript.echo "Installation not done" wscript.quit(1) end if Set objDir = FSO.GetFolder(subpath) For Each aItem In objDir.Files If LCase(Right(Cstr(aItem.Name), 3)) = "inf" Then 35 HP DJ UPD SAG

  • 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
35
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function recovers information from Driver instalation path
' Input Params:
' - path: The Path of the instalation files
' Output Parms:
' - infFile: The INF full path file
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function GetInfFile(path,platform,configDriverSubfolder,infFile)
Dim FSO, objDir, aItem, found, subpath
Dim WshShell
found = false
if path <> "" then
path = path + "\"
else
Set WshShell = WScript.CreateObject("WScript.Shell")
path = wshshell.currentdirectory + "\" + configDriverSubfolder + "\"
end if
Set FSO = CreateObject("Scripting.FileSystemObject")
if Not FSO.FolderExists(path) then
wscript.echo "Folder does not exist"
wscript.echo "Installation not done"
wscript.quit(1)
end if
Set objDir = FSO.GetFolder(path)
For Each aItem In objDir.Files
If LCase(Right(Cstr(aItem.Name), 3)) = "inf" Then
infFile = path + aItem.Name
found = true
exit for
end if
Next
if found = false then
' path does not contain inf. Let's add x86 and x64 subfolders
if platform = "x86" then
subpath = path + "win2k_xp_vista\"
else
subpath = path + "winxp_vista_x64\"
end if
if Not FSO.FolderExists(subpath) then
wscript.echo "No inf found either in " + path + " or in " + subpath
wscript.echo "Installation not done"
wscript.quit(1)
end if
Set objDir = FSO.GetFolder(subpath)
For Each aItem In objDir.Files
If LCase(Right(Cstr(aItem.Name), 3)) = "inf" Then