Access denied when adding printer without user interaction

  • Thread starter Thread starter Albert Balsemhof
  • Start date Start date
A

Albert Balsemhof

Hi @ll,

I am facing the following problem in W2K with SP4. FAT32
From a client PC I run a the following script as a user:

rundll32.exe printui.dll,PrintUIEntry /if /b "HP DeskJet
6122" /f "%windir%\inf\HPDJ6122
\hpf6122k.inf" /r "lpt1:" /m "hp deskjet 6122
series" /n "HP DeskJet 6122"

It starts copying files, but at the end it results in an
Access Denied.

According to the following document 189105 - How to Add
Printers with No User Interaction in Windows this should
be possible.

When I execute this same script on a Windows XP client
without SP, while being logged on as a user it works
perfectly.

I can't understand why it fails on W2K, and I have tried
it with several printer models, always Access denied when
logged on as a user. With Admin account it works, so the
script is correct.

I checked with Filemonitor, and noticed that it looks
continuously for a file called: C:\CATADMIN - File not
found

and I also found a lot of Sharing violations with some
temp files, don't know if this has something to do with
it:

C:\Winnt\system32\spool\drivers\w32x86\set6b.tmp -
Sharing violation

Is this a SP4 issue or is there an other way to get it to
work?

Can someone enlighten me on this ....

Grtz. Albert Balsemhof
 
I guess this is not a problem of your script. Your script seems having no
error. It is because the generic domain user has no right to add LOCAL
printer, they only have right to add network printer.

You can verify this by executing the following command under normal user
context:

rundll32 printui.dll,PrintUIEntry /ii /f %windir%\inf\ntprint.inf

Then you will find the command line trigger the Add Printer Wizard, which
has the add Local Printer option grey out...

Sorry as I didn't have a XP client on hand so I cannot have a try. But I
guess this may because of:
1. the mechanism of impersonation of WinXP is different from Win2K, or
2. the default add printer policy for WinXP is different from Win2K

Any expertise can comment on that please? Thanks.

Cheers.
 
Back
Top