[Samba] installing printer in a logon script

Tomasz Chmielewski mangoo at interia.pl
Mon Nov 8 14:02:05 GMT 2004


Paul Gienger wrote:


> It really sounds like you're not understanding what we're telling you.  
> You need to store the printer driver on the samba server so that when 
> you issue the rundll command, with the /in switch, your client knows 
> what you're talking about.  To do this, go to a windows machine that is 
> already on your network, try your personal station, seems to work well 
> for me.  Follow through the part that I sent the address to.  Really.  
> When you are done, you should be able to run (from your server)
> rpcclient servername
> and then once logged in do an enumdrivers and see them listed.  You 
> should also be able to do an enumprinters and see more interesting 
> information.  If these commands don't work, stop and re-examine your 
> setup.  Any number of things could be wrong so perhaps tell us what you 
> get from those commands.
> 
> When you are done, you should be able to walk over to any machine, issue 
> your rundll command from the command line and all that will happen is 
> that a box will come up saying that it is installing the printer <name> 
> from <host> (or possibly the ip depending on your version of samba) and 
> it should just go away.  Now if you're using 3.0.7 (I believe) there is 
> a known bug in these routines that will cause some issue with your 
> naming.  You'll have to play around with your rundll command and the 
> printer names to get it right.  If you get here, post your enumprinters 
> and enumdrivers output from above and maybe a valid statement can be 
> made for you.

No, sorry, this won't work for me.

My printer-install have to fulfil the following assumptions:

1) printer is installed *fully* automatically - no end-user user 
interaction,
2) as admin can reach Samba and only Samba remotely (and only remotely), 
there can be no walking to a workstation and adding a printer from there.

To sum up:

a) admin knows what printer do they have in these remote offices,
b) admin copies drivers to samba remotely, changes some logon scripts - 
and users of that remote office have printer drivers installed.

It seems I could do it with "rundll32 printui.dll,PrintUIEntry ..." - 
but I can construct a valid command to point to the drivers.
I tried it like that:

rundll32 printui.dll,PrintUIEntry /q /y /ga /if /f 
\\server\shared\HP_2000C\hp_2x00c.inf /in /n \\server\HP_2000C

But it seems to me that Windows is simply ignoring /if /f flags, because 
it doesn't print any error (even with no /q) when I put some nonsense 
instead of the location of the ini file.

Tomek














More information about the samba mailing list