Jump to content

unattended printer install


Recommended Posts


For exapmle:

Dim WSHShell

Set WSHShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "rundll32 printui.dll,PrintUIEntry /if /b " & """" & "LaserJet6L" & """" & " /f %windir%\inf\ntprint.inf /r " & """" & "lpt1:" & """" & " /m " & """" & "HP LaserJet 6L" & """", 2, true

WshShell.Run "rundll32 printui.dll,PrintUIEntry /y /n " & """" & "LaserJet6L" & """", 2, true

Link to comment
Share on other sites

have a look here PrintUI.dll.

I use the following in a batch file to add a printer

RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /n\\Server\PrinterShareName

To remove the printer change the /ga to /gd. You need to run the DLL or batch file with local administrator rights. Note that you still have to login as each profile if you need to change the default printer.

I was put onto this a few months back and have been using it in a batch file to add (or remove) "group" printers. Can be a great time saver if you have several printers to manage for a group.

I don't know immediatelyhow you can incorporate this into an unattended install though?

Hope it helps!

Link to comment
Share on other sites

To add to winnt.sif, i did this =>

extract the deploy.cab to a folder

run setup.exe, fill in the sections just tso it is happy

at the printer section, insert servername\printersharename

then finish

open your unattended.txt file

locate section and copy and paste ths to your winnt.sif

I'll be honest and say i haven't actually tried this, but as is done via official unattended.txt create program, i don't see why not.

Link to comment
Share on other sites

I'm using a tool called "printmig" to add local print drivers unattended. Don't remember where I got it from, I know there is various of it on the net but the one I use is a Microsoft one (according to the about box).

First I have created the printers manually, adding any 3d party drivers and set any settings needed. Then I make a backup of my printers in printmig and it saves all files and settings needed into a single .CAB file.

In my unattended script, I just make a restore using printmig command line options and voila, I have all my printers with all settings restored.

At least, this is MY way of dealing with the printer install... :D

/DrJ

Link to comment
Share on other sites

Im trying to install a network printer via something of the form:

rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "AGFA-AccuSet v52.3"

It works with lpt1: as the port for the command but I want to use an IP address. If I change lpt1: to an ip address it doesnt seem to work. Anyone know whether this is possible and what the correct formatting should be?

Link to comment
Share on other sites

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...