Re: printuientry

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bruce Sanderson (Bruce.Sanderson_at_junk.junk)
Date: 08/23/04


Date: Mon, 23 Aug 2004 15:04:01 -0700

Perhaps we are having a terminology or other confusion.

1. If the printer was created with a "Local Port", it will show up in the
(Power) User's Printers and Faxes folder with a single part name (e.g.
printername).

2. If the printer was created as a "Network Printer", it will show up in the
(Power) User's Printers and Faxes folder with a two part name (e.g.
printername on server name).

To set the default printer as a printer of type 1:

  rundll32 printui,PrintUIEntry /y /n printername

To set the default printer as a printer of type 2:

  rundll32 printui,PrintUIEntry /y /n \\servername\printername

To test this out:

1. logon as an administrator
2. start the Add Printer wizard (you are probably familiar with this, but
I've provided details so we can be sure we are talking apples and not
oranges here)
     a. on the Local or Network panel, select "Local Printer", remove check
mark from "Automatically detect ..."; click Next
     b. select the "Create a new port" radio button
     c. select "Local Port" from the drop down list box; click Next
     d. in the "Enter a port name" text box, key the UNC name of the printer
(e.g. \\servername\printername)
     e. on the "Install Printer Software" panel, select the appropriate
driver; click Next
     f. on the "Name your Printer" panel, in the "Printer Name" text box,
key something unique (e.g. printernamelocal); click Next
     g. on the "Printer Sharing" panel, select the "Do not share this
printer" radio button
     h. on the "Print Test Page" panel, select "Yes"; click Next
     i. click Finish
verify that the Test Page printed
3. open a command prompt and issue the commands:

     rundll32 printui,PrintUIEntry /ga /n \\servername\printername
     net stop spooler
     net start spooler

4. logoff
5. logon with a user account that is a "User" or "Power User"
6. open Printers (or Printers and Faxes) - both printers should show up
(e.g. printernamelocal and printername on servername); right click on each
printer in turn, select Properties and print a Test Page. Verify that both
print OK.
7. in the Printers folder, right click on "printername on servername" and
select it as the default printer (this is just so we know the starting
state)
8. open a Command Prompt window
9. key the command

       rundll32 printui,PrintUIEntry /y /n printernamelocal
observe that in the Printers folder this printer immediately becomes the
default printer

10. key the command
      rundll32 printui,PrintUIEntry /y /n \\servername\printername
observe that the "printername on servername" immediately becomes the default
printer

I tested this scenario on a computer that is not in a domain and also on a
computer that is a member of a Windows 2000 domain and it worked just fine
in both situations for "Users" and "Power Users".

If this scenario fails for you, please say which numbered step it fails at
and exactly what the symptom is (error message etc.).

-- 
Bruce Sanderson MVP
It's perfectly useless to know the right answer to the wrong question.
"panda" <sam_bixby@hotmail.com> wrote in message 
news:2bbf249f.0408230125.3f92f36e@posting.google.com...
> When im logged on as network administrator, the batch (following) runs
> correctly, however when on as a power use it does not work.
>
> rundll32 printui,PrintUIEntry /y /n "\\stationname\printersharename"
>
> this suggest to me that it is a permissions issue
>
> panda
>
> "Bruce Sanderson" <bsanders@junk.junk> wrote in message 
> news:<#7$KvLJiEHA.2764@TK2MSFTNGP11.phx.gbl>...
>> That message is sort a generic message that is the response to most 
>> failures
>> of PrintUIEntry.  It tries to give you a hint about what might be wrong, 
>> but
>> does not necessarily identify what actually is wrong.
>>
>> My test show that an ordinary user can use the "rundll32
>> printui,PrintUIEntry /y /n printername" command successfully, so 
>> presumably
>> you could put it into a logon script.  Most of the other available 
>> functions
>> (including /in) require the user to be an administrator on the targeted
>> computer.  The /y function (set default printer) will fail (with the 
>> message
>> you describe) if the named printer does not exist (e.g. name spelt 
>> wrong).
>>
>> Actions taken on the print client computer (e.g. /y - set default printer 
>> or
>> /ga - add  a printer for all users - see
>> http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm) do not require
>> administrative rights and permissions on the print server computer ("the
>> machine with the printer").
>>
>> -- 
>> Bruce Sanderson  MVP
>>
>> It is perfectly useless to know the right answer to the wrong question.
>>
>>
>> "panda" <sam.bixby@wolfreton.eril.uk> wrote in message
>> news:PiCdnYmx3pMfxLXcSa8jmA@karoo.co.uk...
>> >I have just remebered one problem I had, when I tried running this, an
>> >error
>> > message appeared saying that the printer was no longer on the server. 
>> > This
>> > was true whether the batch file was run as a logon script or as the 
>> > user
>> > when logged on. The error did not occur as a network administrator. I
>> > tried
>> > making the user a local administrator with no luck. do they also need 
>> > to
>> > be
>> > administrator on the machine with the printer? is there another 
>> > permission
>> > I
>> > am missing? This was the reason I was trying to set permission for
>> > everyone
>> > using a system logon.
>> >
>> > Thanks
>> >
>> > Panda
>> >
>> >
>> > "Bruce Sanderson" <Bruce.Sanderson@junk.junk> wrote in message
>> > news:uMY6uOwhEHA.632@TK2MSFTNGP12.phx.gbl...
>> >> 1. "Default printer" is a per user setting, not a per computer 
>> >> setting,
>> >> so
>> >> it may not make sense to set it in a "startup" script (as opposed to a
>> >> "logon" script).
>> >>
>> >> 2. I've tried several variations on the command syntax and can not get 
>> >> it
>>  to
>> >> work remotely.  When the command is run locally (to take action on the
>>  same
>> >> computer that the command is initiated from), there is no need to use 
>> >> the
>>  /c
>> >> parameter.
>> >>
>> >> 3. the syntax that works for the currently logged on user locally is:
>> >>
>> >>    rundll32 printui,PrintUIEntry /y /n printername
>> >>
>> >> where printername is the name that is on the General tab of the 
>> >> printer's
>> >> properties.  If this name has spaces in it, enclose printername in 
>> >> double
>> >> quotes ("printername").
>> >>
>> >> 4. the /in function is for adding a network printer connection.  If 
>> >> the
>> >> printer is already defined on a "local port", then the printer 
>> >> (although
>>  it
>> >> is actually physically connected to another computer), is, by 
>> >> definition,
>>  a
>> >> Local Printer.  True Network Printers do not have local ports.  See
>> >> :port"
>> >> and "printer" at http://members.shaw.ca/bsanders/Glossary.htm.
>> >>
>> >> --
>> >> Bruce Sanderson MVP
>> >>
>> >> It's perfectly useless to know the right answer to the wrong question.
>> >>
>> >>
>> >> "panda" <sam_bixby@hotmail.com> wrote in message
>> >> news:2bbf249f.0408200050.3841112c@posting.google.com...
>> >> >I am trying to add set a printer as default using the following
>> >> > command...
>> >> >
>> >> > RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /in /n "printer" /c\\computer
>> >> >
>> >> > the complication is that the printer already exists on this 
>> >> > computer,
>> >> > it is using a local port , but is physically attached to a different
>> >> > network computer.
>> >> >
>> >> > so my questions are;
>> >> >
>> >> > do i need to included the name of the computer that the printer is
>> >> > attached to, or can i just use the printers sharename.
>> >> >
>> >> > is the syntax of the command correct?
>> >> >
>> >> > is there any reason why this shouldnt work when set as a startup
>> >> > script on the computer?
>> >> >
>> >> > sam.bixby@wolfreton.removeme.eril.net
>> >>
>> >>
>> >
>> > 


Relevant Pages

  • Re: printuientry
    ... you could put it into a logon script. ... The error did not occur as a network administrator. ... I've tried several variations on the command syntax and can not get it ... >> printer is already defined on a "local port", ...
    (microsoft.public.win2000.printing)
  • Re: printer no longer prints
    ... power on printer to no avail 8-( ... it's grey'd out 8-(If I 'Become Administrator' ... Is there a way to do this via command ... I could start thie whole operation off with an 'su'. ...
    (comp.os.linux.hardware)
  • Re: printer no longer prints
    ... power on printer to no avail 8-( ... If I 'Become Administrator' I never see the option again. ... Is there a way to do this via command line? ... I could start thie whole ...
    (comp.os.linux.hardware)
  • Re: asrock, problem with nic after windows-boot - Exact Opposite issue the OP is having
    ... Yup - just like the switch on the power strip that you used instead (so you ... 0xFFFFFFF0 address, but the /RESET line isn't asserted, so the hardware ... and another command to learn is 'grep' and 'zgrep' (which handles compressed ... HTML ...
    (comp.os.linux.networking)
  • Re: IE Explorer 6.0 Locking Up On A Web Page Account
    ... Thanks, I will try that running that command again, it didn't work when I ... Connection May No Longer Be Needed was checked, so I uncheck it. ... computer turn OFF this device for Power saving. ... winsock reset command and then reboot the system. ...
    (microsoft.public.windowsxp.general)