The best way to run an exe file within a windows service

J

Jie Wang [MSFT]

Hi Max,

There is no universally best way to do that - it depends on the
requirements.

My understanding is, you want to print PDF files unattended by calling
Adobe Acrobat Reader from within your service and no user interaction is
needed. If I got it wrong, please correct me.

That raises a problem in the first place: Does Adobe Acrobat Reader support
running under a service account (like SYSTEM or LocalService or
NetworkService)? I think you need to get the answer to this question from
Adobe then we can proceed to the next step.

Another consideration would be the printer, if you're using a remote
printer on the network, usually the account running your service is not
aware of this kind of printers. You'll have to install the printer locally.

If your service only will print PDF files when an interactive user is
logged on in the system, then you can use CreateProcessAsUser function to
run the Acrobat Reader process on that user's desktop. See:
http://msdn.microsoft.com/en-us/library/ms682429(VS.85).aspx

Or you can use a server/client model to have the job done: make another
application running on the interactive user's desktop, use Remoting or some
other cross process communication technologies to let the print command go
through from the service to the client application. Then the client
application can run the Acrobat Reader to do the print job.
See: http://support.microsoft.com/kb/327618/

These are my first thoughts with not enough information available from you.
If you could describe more details about what exactly your application need
to do, then I can give more specific information on this topic.

Thanks,

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top