3 Replies - 526 Views - Last Post: 31 January 2014 - 12:42 PM Rate Topic: -----

#1 Golossos  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 118
  • Joined: 29-June 13

How would I add a printer in XP via batch/PowerShell?

Posted 23 January 2014 - 02:56 PM

Unfortunately, PowerShell 4.0 is only available to new versions of Windows Server and Windows 8/8.1, and my work is upgrading sometime in the future. I want to be able to add a LOCAL printer (not TCP/IP) using a printer driver found on the hard drive, with the port being \\PrintServer\ServerShare. How would I go about executing this? I have tried countless options including VBScript (where I was able to add the actual printer but not create the port), and simply using PrintUI.

Any help is appreciated. I work in a help desk and would figure that configuring printers via command line would be more efficient than chugging through the Add Print Wizard every time.

Is This A Good Question/Topic? 0
  • +

Replies To: How would I add a printer in XP via batch/PowerShell?

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5392
  • View blog
  • Posts: 27,387
  • Joined: 10-May 07

Re: How would I add a printer in XP via batch/PowerShell?

Posted 23 January 2014 - 03:02 PM

** This isn't related to Windows Computer Support, moved to Programming Help --> Other Languages **
Was This Post Helpful? 0
  • +
  • -

#3 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1432
  • View blog
  • Posts: 4,968
  • Joined: 19-February 09

Re: How would I add a printer in XP via batch/PowerShell?

Posted 26 January 2014 - 06:17 PM

Hi. \\PrintServer\ServerShare is a network printer and not local is it not.

Install printers using Batch Files

You could try inf install if the driver has an inf. That might add the printer.

add printer something like (in=install network printer):
rundll32 printui.dll, PrintUIEntry /in /q /n"\\Server\Printer"



Then you might want to set it as default.

There is also store printer settings to a file, and restore settings from a file. So you could try getting the settings from a machine you have setup, and use the file data on a clean machine.
.

This post has been edited by #define: 26 January 2014 - 06:19 PM

Was This Post Helpful? 0
  • +
  • -

#4 Golossos  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 118
  • Joined: 29-June 13

Re: How would I add a printer in XP via batch/PowerShell?

Posted 31 January 2014 - 12:42 PM

View Post#define, on 26 January 2014 - 06:17 PM, said:

Hi. \\PrintServer\ServerShare is a network printer and not local is it not.

Install printers using Batch Files

You could try inf install if the driver has an inf. That might add the printer.

add printer something like (in=install network printer):
rundll32 printui.dll, PrintUIEntry /in /q /n"\\Server\Printer"



Then you might want to set it as default.

There is also store printer settings to a file, and restore settings from a file. So you could try getting the settings from a machine you have setup, and use the file data on a clean machine.
.

Thanks. This is a network printer that will be installed with a .inf; what confused me at the time was using the switch /r instead of /n in specifying the path.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1