I am working on a script that will add printers, ports, enable printer pooling, and assign multiple ports to a printer. The catch to this is that thinPrint is being used to manage the printers. If I add the printer ports as a local port in the registry, thinPrint will not pick it up....however, if I add the printer without the local ports, the printer will not install. Does anybody have any experience automating thinPrint?....or installing printers on NOT a local port?
Here is my code so far...
AutoIt
#include <GuiConstants.au3> #include <buttonconstants.au3> #include <windowsconstants.au3> #include <StaticConstants.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <File.au3> #include <zip.au3> installPrinters() MsgBox(64, "Please Read!", "The first time thinPrint Helper is ran you must create each individual printer and then reboot the Server. After reboot, running thinPrint Helper will install the printers. You're welcome!") While 1 EndFunc ;==>main FileWrite($file, "Windows Registry Editor Version 5.00" & @CRLF & @CRLF & '[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\ThinPrint Port\' & $user & '-1:]' & @CRLF & '"Protocol"=dword:00000002' & @CRLF & '"NetSend"=dword:00000001' & @CRLF & '"WTSMsgBox"=dword:00000001' & @CRLF & '"CompressData"=dword:00000000' & @CRLF & '"PackagesAccess"=dword:00000001' & @CRLF & '"SendPackages"=dword:00000001' & @CRLF & '"PackageSize"=dword:0000fa00' & @CRLF & '"BandwidthAccess"=dword:00000000' & @CRLF & '"Bandwidth"=dword:0003e800' & @CRLF & '"BandwidthCtrlEnabled"=dword:00000000' & @CRLF & '"Port"=dword:00000fa0' & @CRLF & '"Filter"="l"' & @CRLF & '"PrinterQueueName"=""' & @CRLF & '"TPACScheme"="%N#%U:%I"' & @CRLF & '"FormatString"="%*[^#]#%[^:]:%s"' & @CRLF & '"IsVCGPort"=dword:00000000' & @CRLF & '"IsCSvcPort"=dword:00000000' & @CRLF & '"LogJobStatistic"=dword:00000000' & @CRLF & '"RefreshTimeJobStat"=dword:000003e8' & @CRLF & '"CLevel"=dword:00000005'&@CRLF) FileWrite($file, '[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\ThinPrint Port\' & $user & '-2:]' & @CRLF & '"Protocol"=dword:00000002' & @CRLF & '"NetSend"=dword:00000001' & @CRLF & '"WTSMsgBox"=dword:00000001' & @CRLF & '"CompressData"=dword:00000000' & @CRLF & '"PackagesAccess"=dword:00000001' & @CRLF & '"SendPackages"=dword:00000001' & @CRLF & '"PackageSize"=dword:0000fa00' & @CRLF & '"BandwidthAccess"=dword:00000000' & @CRLF & '"Bandwidth"=dword:0003e800' & @CRLF & '"BandwidthCtrlEnabled"=dword:00000000' & @CRLF & '"Port"=dword:00000fa0' & @CRLF & '"Filter"="l"' & @CRLF & '"PrinterQueueName"=""' & @CRLF & '"TPACScheme"="%N#%U:%I"' & @CRLF & '"FormatString"="%*[^#]#%[^:]:%s"' & @CRLF & '"IsVCGPort"=dword:00000000' & @CRLF & '"IsCSvcPort"=dword:00000000' & @CRLF & '"LogJobStatistic"=dword:00000000' & @CRLF & '"RefreshTimeJobStat"=dword:000003e8' & @CRLF & '"CLevel"=dword:00000005'&@CRLF) FileWrite($file, '[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Monitors\ThinPrint Port\' & $user & '-3:]' & @CRLF & '"Protocol"=dword:00000002' & @CRLF & '"NetSend"=dword:00000001' & @CRLF & '"WTSMsgBox"=dword:00000001' & @CRLF & '"CompressData"=dword:00000000' & @CRLF & '"PackagesAccess"=dword:00000001' & @CRLF & '"SendPackages"=dword:00000001' & @CRLF & '"PackageSize"=dword:0000fa00' & @CRLF & '"BandwidthAccess"=dword:00000000' & @CRLF & '"Bandwidth"=dword:0003e800' & @CRLF & '"BandwidthCtrlEnabled"=dword:00000000' & @CRLF & '"Port"=dword:00000fa0' & @CRLF & '"Filter"="l"' & @CRLF & '"PrinterQueueName"=""' & @CRLF & '"TPACScheme"="%N#%U:%I"' & @CRLF & '"FormatString"="%*[^#]#%[^:]:%s"' & @CRLF & '"IsVCGPort"=dword:00000000' & @CRLF & '"IsCSvcPort"=dword:00000000' & @CRLF & '"LogJobStatistic"=dword:00000000' & @CRLF & '"RefreshTimeJobStat"=dword:000003e8' & @CRLF & '"CLevel"=dword:00000005'&@CRLF) EndFunc ;==>createPrinters $count = 1 $count = $count + 1 EndFunc ;==>installPrinters
Any help is appreciated.
Thanks!