Link to home
Start Free TrialLog in
Avatar of thenelson
thenelson

asked on

User permissions for "rundll32 printui.dll,PrintUIEntry /Sr

The following line:
rundll32 printui.dll,PrintUIEntry /Sr /n "OKIPAGE 10i" /a "\\Server1\E\My Documents\Databases\Contact Envelope Primary.ptr"
works fine as an administrator but gives a "cannot complete the operation" error as a user.  What permission needs to be set, where do I find it and can I set it from MSAccess VB to give the users permission to run the above line?
Avatar of chouproute
chouproute

I think you had better to ask it into Programming tab.
But MS Access VB are not like VB. Something there is some difference. So maybe just check if there is other way to execute your line.

Did you tries this on many OS? Maybe just a sharing problem from Server1.

Good Luck

Marco
To install printers, a user needs to be at minimum, a member of the Power Users group.

I doubt you can set it from MSAccess, at least while the user is logged in as a normal User.  You'd have to log in as an administrator, or Right-Click, Run As, on the Computer Management console and run it as a local admin to add them to the Power Users group.  If you're on a domain, remember it's Power User rights on the local computer that they need, not on the domain.

-Bernie
Avatar of thenelson

ASKER

It is not a sharing problem with server1.  rundll32 printui.dll,PrintUIEntry /Ss /n "OKIPAGE 10i" /a "\\Server1\E\My Documents\Databases\Contact Envelope Primary.ptr" which writes the printer settings to the folder works fine.  I can copy the file as a user.  

I am not installing a printer rundll32 printui.dll,PrintUIEntry /Sr /n "OKIPAGE 10i" /a "\\Server1\E\My Documents\Databases\Contact Envelope Primary.ptr" copies printer settings from the named file.

rundll32 printui.dll,PrintUIEntry /? will pop up a printer user interface listing all the available commands.
I am making this question a pointer to: https://www.experts-exchange.com/questions/21388599/User-permissions-for-rundll32-printui-dll-PrintUIEntry-Sr.html and I will request this question be deleted when the answer is posted in https://www.experts-exchange.com/questions/21388599/User-permissions-for-rundll32-printui-dll-PrintUIEntry-Sr.html.  Please make any additional comments in that question.  Thank you.

I have just learned the following from https://www.experts-exchange.com/help.jsp#hi262:
"A pointer question should state the title, number of points offered, and a brief summary of the original question. Make the pointer question worth the minimum number of points. To make it absolutely clear, include a statement like "Please direct all your comments to the original question" and then provide a link to that question. The pointer question should be deleted (and your points refunded) when you accept an answer in your original question."
WELL, I FIGURED OUT HOW TO SOLVE THE PROBLEM!  I just added the switch "u" at the end of the  rundll32 printui.dll,PrintUIEntry /Sr  and /Ss lines.  Not only does it solve the problem but it also makes the saved file smaller and the commands run faster!

Thanks to all for your responses.  I now have a system for Access (or any other VB project) that can store which printer and printer settings to use for a form, report or command.  Change the printer and settings, print then change it back.  If anyone would like the code for it let me know.
ASKER CERTIFIED SOLUTION
Avatar of PashaMod
PashaMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial