ok ich habs herausgefunden, war einfacher als ich dachte, für die die das selbe Problem haben, hier kurz das Vorgehen:
AutoIt
Func _conIPprt()
Local $sipPrinter = GUICtrlRead($mPrinterGuis[@GUI_WinHandle].idIPPrinters)
Local $aList = IPprt()
Local $vbsScriptPath = "C:\Windows\SysWOW64\Printing_Admin_Scripts\de-DE\prnport.vbs"
Local $printerPort = '9100'
For $i = 1 To UBound($aList) - 1 ;read out TableValues
If $aList[$i][0] & " - " & $aList[$i][1] = $sipPrinter Then
$PrName = $aList[$i][0]
$Port = $aList[$i][1]
$ip = $aList[$i][2]
$driver = $aList[$i][3]
$pName = $aList[$i][4]
$room = $aList[$i][5]
$TS = $aList[$i][6]
ExitLoop
EndIf
Next
;MsgBox(262144,"Driver", $driver)
RunWait('cscript.exe "' & $vbsScriptPath & '" -a -r ' & $Port & ' -h ' & $IP & ' -o raw -n ' & $printerPort, "", @SW_HIDE) ;make port
RunWait(@SystemDir & "\RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b " & '"' & $PrName & '" /f "' & $driver & '" /r "' & $Port & '" /m "' & $pName & '" /z') ; connect printer
RunWait(@SystemDir & "\RUNDLL32 PRINTUI.DLL,PrintUIEntry /q /y /n " & '"' & $PrName & '"') ; make standard
; RunWait(@SystemDir & "\RUNDLL32 PRINTUI.DLL,PrintUIEntry /k /n " & '"' & $PrName & '"') ; Testdruck
EndFunc
Alles anzeigen
Frohe Pfingsten