Adding a printer without much user intervention

RMSe17

Member
Feb 20, 2005
153
0
0
Hi, I am trying to develop a script that a user can run in order to set up our lab printers on a the user's laptop. The printer queues are set up on a server within our AD network. Since the user name on our AD network may not match the user name on their personal laptop, a way needs to exist for them to enter their username/password some time during the script execution to set up the queue with known credentials.


From what I read so far, I found two ways to do this, but couldnt get either to work. First way was to do a
net use LPT4: \\server\queue_name /USER: Domain\username

but for some reason, even though "net use" shows that a printer was mapped to LPT4, when I go to something like microsoft word, and select Print.. there doesnt appear any printers installed. No idea how to proceed there.

Another way I read about was to use the "rundll32 printui.dll,PrintUIEntry" with a bunch of parameters, but I didn't see any parameter that would allow me to specify a username (or request a username) during the execution of the command. Seems to me that it uses the currently logged in username, which is not really an option for us.

I also read that there is a more advanced dll from the server resource kits, prnadmin.dll but I have no idea how to use it yet.

Am I missing something very simple in either of the two ways? or is there no way to easily do what I need with batch file, and I need to consider doing something more advanced? Also, if you aren't sure how to do any of this, but know of some other place where I could get help with this, please let me know.

Thanks,
RMSe17