Deleting a printer using rundll32 printui.dll,PrintUIEntry

R

Rich S

I use the rundll32 printui.dll,PrintUIEntry command line
in a batch file to push install a printer to client
computers without having to go to the actual computer,
this works perfectly. The problem I have is when I logoff,
I use a batch file with the following entry:

rundll32 printui.dll,PrintUIEntry /dl /b "HSINFO-P2" /c\\%
computername%

I get the following error message

Printer could not be removed. You either entered a printer
name that was incorrect or the specified printer is no
longer connected to the server.

I can see the printer entry under Printers in the Control
Panel, I can print with no problem, I just cannot delete
it when I log off, if it is not deleted I keep getting
duplicate entries of the same printer every time a student
logs on, I can have hundreds of duplicate entries in a
weeks time, even with all the duplicate entries students
can print with no problem.

What am I missing ? HELP !!!

Thanks,
Rich
 
B

Bill Stewart

Rich S said:
I use the rundll32 printui.dll,PrintUIEntry command line in a batch file
to push install a printer to client computers without having to go to the
actual computer, this works perfectly. The problem I have is when I
logoff, I use a batch file with the following entry:

rundll32 printui.dll,PrintUIEntry /dl /b "HSINFO-P2" /c\\% computername%

I get the following error message

Printer could not be removed. You either entered a printer name that was
incorrect or the specified printer is no longer connected to the server.

I can see the printer entry under Printers in the Control Panel, I can
print with no problem, I just cannot delete it when I log off, if it is
not deleted I keep getting duplicate entries of the same printer every
time a student logs on, I can have hundreds of duplicate entries in a
weeks time, even with all the duplicate entries students can print with
no problem.

What am I missing ? HELP !!!

Rather than this approach, I recommend using "per-machine" printers...

rundll32 printui.dll,PrintUIEntry /ga /n"\\PRINTSERVER\Printer Name"

These printers show up no matter who logs on, so you only have to add them
once.

I am writing a custom DLL and GUI program that manages per-machine
printers. I will post the location here when it's finished.

HTH,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top