views:

21

answers:

1

Alright, I was tasked to develop a Windows Service that listens to a directory for files that are dropped in it, read them, delete them and print out a report.

I installed the service on my work laptop (Win 7 x86) and a test machine (XP x86) under a User account at first. It would do everything as it should except the print the report. No errors, nothing. Then I made it run under Local System and it produced a "No printers found" exception.

Converting the app to a Console Application and running on these machines gave the desired result. OK, so now I was assuming that there are security "stuff" involved.

Then I installed the service on a Server 2008 x64 machine (under Local System) and it just worked. Can anybody explain to me why this is happening? Why does the service allow printing from Server OS but not from a Desktop OS or am I missing something very obvious?

+1  A: 

I'm guessing that the printers are installed locally on the server but installed as network printers on the desktop. Local System only have access to local printers.

ho1
Nope. At the moment the laptop and server are standing next to each other both using a Network Printer. I did notice though that the service ignores PDF printers like CutePDF Writer. This I can understand (interacting with the desktop etc).
Andre
Just to make sure that we're talking about the same thing, are you sure that the network printer is actually installed as a network printer on both computers? You can install network printers as a local printer. It's quite common for a network printer to be installed as a local printer on the server and then the clients install it via the server (so they can get the drivers from the server rather than having to install them from a cd or similar).
ho1
I am fairly confident that the printer is not installed as a local printer on the server. It is a small dev machine that was setup the other day. The chances of the guy who set it up contacting our tech department and asking for a printer's disc to install it rather than just installing it over the network is very remote. (I will check this out though).
Andre