Solved

Service can't print while not logged in

Posted on 2002-07-29
5
151 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
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

810 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