0

The Problem is my exe is started by a service, and in that exe i gave a call to ShellExecute to open a link. In this case the ShellExecute always open the link in IE instead of Default Web Browser.

I think when i execute the exe through a service it does not run in user context so it does not open link in default web browser.

Can any one help me how to open the link in default web browser in this case.

Anup
  • 61
  • 1
  • 9
  • possible duplicate of [Is it possible for a Windows service impersonate a user without a password?](http://stackoverflow.com/questions/8304398/is-it-possible-for-a-windows-service-impersonate-a-user-without-a-password) – πάντα ῥεῖ Jun 27 '14 at 06:53

1 Answers1

1

You will need to impersonate the user account/context within the service. Use this link to know how to impersonate an active user context in a service.

Community
  • 1
  • 1
Kajal Sinha
  • 1,565
  • 11
  • 20
  • Giving link only answers is bad, since links can invalidate and thus the answer becomes useless. Please copy the essentials from the link to your answer. – πάντα ῥεῖ Jun 27 '14 at 06:48
  • 2
    Indeed and my first line of answer is the summary of what is there in the link. Also I have considered that 1) The link is within Stackoverflow 2) Adding more information by just copying and not out of your own mind/experience is a little close to stealing 3) if 'that' stackoverflow link is useful then that link should get an upvote instead of mine. – Kajal Sinha Jun 27 '14 at 07:23
  • @ πάντα ῥεῖ : You're missing the point of that rule. The link here isn't the answer to the question, but it explains how to implement the answer. The actual rules covers the situation where the link points to the answer itself. – MSalters Jun 27 '14 at 10:34