Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for login_connect.bat_style_network_printer.vbs

(view source code of login_connect.bat_style_network_printer.vbs as plain text)

  1. Set wshNetwork = CreateObject( "WScript.Network" )
  2. On Error Resume Next
  3. wshNetwork.AddPrinterConnection "LPT1", "\\Server\HPLJ4", False
  4. If Err Then
  5. 	WScript.Echo "Error " & Err.Number & " while trying to connect to HPLJ4"
  6. 	WScript.Echo "(" & Err.Description & ")"
  7. End If
  8. On Error Goto 0
  9. Set wshNetwork = Nothing

page last modified: 2022-10-20