Jump to content

Recommended Posts

Posted

I know how to add a printer from a windows print server. You click on the share, and it installs. The problem is , the connection is profile specific. Does anyone have a snippit of code that will install the printer on a machine level, not a profile level? In other words, no matter who logs on to the PC, the printer will be installed.

Posted (edited)

I used google at first, but what I found was somewhat confusing. What I was hoping for was a simple GUI that you typed in the server name, and a list of printer shares would be shown. You pick what you want, and click install. It would install them on a machine level.

What I did find: http://www.robvanderwoude.com/2kprintcontrol.html

The thing I find confusing is the fact that they talk about having to show what driver is being used, inf files and so forth. I know I do not need all these things for we have a utility that does it. The utility however does other things outside of installing of printers that I like to avoid so I rather either get a different script that can do it, or just the command line so I can make it myself. If someone could show me the command line to install a printer on a machine level, I can do the rest. The following is a example of a printer I need to install on a PC. Usually you can double click, and it installs, but this is profile specific. I need it machine level.

Server name: pserv1

printername: testprinter1

share over network: \\pserv\testprinter1

---------------

edit: I tried this, and it didn't work: RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /c\\USV34708Q0 /n\\va017f1a\02_3600

Edited by vollyman
Posted

here is the example given, and it is real simple. It is in DOS, but it is easy to make it work for AutoIt.

  Quote

@Echo off

REM this command file will add a network printer to a computer remotely

REM the parameters are:

REM 1 - the name of the computer to which the network printer is to be added

REM 2 - the UNC name of the printer to be added

REM for example, to add the printer called ThePrinter that is shared from the computer PrintServer

REM to the computer called TheClient:

REM key this command in a Command Prompt window:

REM addglobalprinterremotely theclient printserver\theprinter

REM add the specified printer to the specified computer

@Echo On

rundll32 printui.dll,PrintUIEntry /ga /c\\%1 /n\\%2

@Echo off

REM stop the print spooler on the specified computer and wait until the sc command finishes

@Echo On

start /wait sc \\%1 stop spooler

@Echo off

REM start the print spooler on the specified computer and wait until the sc command finishes

@Echo On

start /wait sc \\%1 start spooler

@CyberSlug: THANKS!

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...