Code: Select all
Define mon.MONITOR_INFO_2, drv.DRIVER_INFO_3, prn.PRINTER_INFO_2
With mon
  \pEnvironment = @""
  \pName = @"newMonitor"
  ;not sure what DLL should be used here
  \pDLLName = @"?.dll"
EndWith
;also tried with the full path - C:\Windows\System32\DriverStore\FileRepository
With drv
  \cVersion = 3
  \pDriverPath = @"\driverPath\PSCRIPT5.DLL"
  \pConfigFile = @"\driverPath\PS5UI.DLL"
  \pHelpFile = @"\driverPath\PSCRIPT.HLP"
  \pDataFile = @"\driverPath\MSXPSINC.PPD"
  \pDependentFiles = @"\driverPath\PSCRIPT.NTF"
  \pEnvironment = @"Windows NT x86"
  \pName = @"Miscrosoft PS Class Driver"
EndWith
With prn
  \pServerName = @""
  \pPrinterName = @"myPrinter"
  \pDriverName = @"Microsoft PS Class Driver"
  \pPortName = @"e:\printJobs\file.ps"
  \pPrintProcessor = @"WinPrint"
  \Priority = 1
  \DefaultPriority = 1
  \pDatatype = @"RAW"
  \pShareName = @"myPrinter"
  \pComment = @"myPrinter File Capture"
  \pLocation = @"local computer"
  \Attributes = #PRINTER_ATTRIBUTE_LOCAL | #PRINTER_ATTRIBUTE_SHARED
EndWith
;need these 3 functions to install the printer driver
AddMonitor_(#Null$, 2, @mon)
AddPort_(#Null, #Null, @"newMonitor")
AddPrinterDriver_(#Null, 3, @drv)
;this works if the printer driver is already installed
AddPrinter_(#Null, 2, @prn) 
 Any help is appreciated. Thank you.



