2

What's the best way to set-up a user's printers using NETLOGON.bat?

cagcowboy
  • 1,064
  • 1
  • 14
  • 21

3 Answers3

5

With Windows 2000 and higher, you can use a VBScript as the logon script instead of just a batch file. From there, it's very simple.

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\server\HP LaserJet"

VBScript can also handle typical logon functions such as mapping drives and running programs, in case you netlogon.bat is also doing other things. Google will turn up lots of pages helping with the syntax.

Joe Doyle
  • 1,681
  • 14
  • 15
3

Additionally, you can install printers through Group Policy if you are using Windows XP or later and have installed the Group Policy Client Side Preferences on your clients (see kb943729).

If you don't have Windows 2008 domain controllers, you will need a Vista SP1 client or Windows 2008 server with RSAT installed in order to setup client side preferences through the Group Policy management console.

Doug Luxem
  • 9,592
  • 7
  • 49
  • 80
1

From a batch file:

rundll32 printui.dll,PrintUIEntry /in /n \\server\printer

Here is a complete article on the usage: http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm

Zoredache
  • 128,755
  • 40
  • 271
  • 413
JJ01
  • 451
  • 5
  • 17