CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    9

    Starting process from service

    Hi all,

    I have a service which start a process when system boots.
    When user log off, the process is shutdown but the service is still running.
    I want that when the user logon, the service to start the process again.

    How can I do that?
    I need it to run under win 7 and win xp.

    Thanks.

  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Starting process from service

    I think the best approach would be if you use WMI class Win32_LogonSession.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Starting process from service

    Quote Originally Posted by eyasso
    I have a service which start a process when system boots.
    When user log off, the process is shutdown
    but the service is still running.
    Considering the second part of the highlighted I believe you meant "user logs in interactively" instead of "system boot." Otherwise I don't understand why the process shuts at user's logoff.
    I want that when the user logon, the service to start the process again.
    Why would service care about running the process. Properly registered process could be run by Windows shell, as most of such are.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured