打印机添加实例
$SetPrintIP = "192.168.50.154"
$SetPrintname = "HP LaserJet Pro m226dw"
$SetPrintinf = "HP LaserJet Pro MFP M225-M226 PCL 6"
$SetPrintportname = "IP_" & $SetPrintIP
If @OSArch = "X86" Then
$OSArch = "Windows NT x86"
$SetPrintdriver = "hpcm225c.inf"
EndIf
If @OSArch = "X64" Then
$OSArch = "Windows x64"
$SetPrintdriver = "hpcm225u.inf"
EndIf
_PrintMgr_AddPrinterDriver($SetPrintname, $OSArch, @TempDir & "\" & $SetPrintname, @TempDir & "\" & $SetPrintname & "\" & @OSArch & "\" & $SetPrintdriver)
_PrintMgr_AddTCPIPPrinterPort("IP_" & $SetPrintIP, $SetPrintIP, 9100)
_PrintMgr_AddPrinter($SetPrintname, $SetPrintinf, "IP_" & $SetPrintIP)