Solved

Service can't print while not logged in

Posted on 2002-07-29
5
153 Views
Last Modified: 2010-05-01
When I have my VB app running as a service and attemt to print to one of the printers I get the error

Unable to set selected printer (\\Server\Printer) as active printer when I try to set the active printer

and
Print Error 482 when I try to print regardless (as you do)

which is probably no active printer (surprise surprise)

Yes, I'm not logged in the service executes under a service account.

I can see the network drives not logged in (using unc's) but the printers disapear.
0
Comment
Question by:innovate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Expert Comment

by:sanjaykattimani
ID: 7187275
Yes if you are not logged in, you will not be able to print on network printer as you will not have access to them. if you want you can avoid the error by checking the currently logged in user name in your code.
0
 
LVL 2

Author Comment

by:innovate
ID: 7187363
Services such as BackupExec are able to print to network printers when the Server is not logged in so it is possible.

The Service executes with Admin rights and can see ALL network drive shares, it MUST be able to see the printers.
0
 
LVL 4

Accepted Solution

by:
mcoop earned 100 total points
ID: 7187425
You may need to create a temprary 'share' to the desired printer - although I know how to connect to shares in code - I don't know how to get to the printers...
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7187869
Can you run your service as specific user by setting your service properties
0
 
LVL 2

Author Comment

by:innovate
ID: 7189602
Yes EDDYKT,

As mentioned the service executes under a particular account which has Admin rights.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question