Windows – How to configure a network printer using command prompt under Windows 7

command linenetwork-printerwindows 7

I have a network printer that is properly shared under Windows 7 on network with Windows 7 computers, but when configuring it in command prompt with:

net use lpt1: \\zzzz\laser /persistent:yes

then it requires a user name and password. How can I configure the printer so that this is no longer required?

Best Answer

To add a network printer through the command line:

rundll32 printui.dll,PrintUIEntry /ga /c\\computername /n\\servername\printersharename

This adds the shared printer on the server for all users of the computer "computername". Note that PrintUIEntry is case-sensitive, which can be a bit of a pitfall.

Refer to http://technet.microsoft.com/en-us/library/ee624057(v=ws.10).aspx for more details.

Related Question