CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2015
    Posts
    100

    how to register an exe file in windows startup service routine

    I want to register an exe in windows 7 startup so when ever i start the windows the exe as to be running in backgroungd so please let me know if there is any solution to register an exe in windows startup

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: how to register an exe file in windows startup service routine

    A program that starts whenever Windows starts is known as a service. See https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx for further details.

    Also you can create a service from an .exe see
    http://stackoverflow.com/questions/3...rom-executable
    http://support.microsoft.com/kb/251192
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    Join Date
    Jan 2015
    Posts
    100

    Re: how to register an exe file in windows startup service routine

    Hi,

    i gone through it what ever you sent i want to register an exe like example helloworld.exe file which as to be running in background like antvirus softwares kaspersky which is running in background which will be register in service routine i want to register an helloworld.exe in service routine

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: how to register an exe file in windows startup service routine

    Anti-virus software uses Windows services which need to be written as Window services. I gave you the link as to these details.

    If you want to use an existing .exe as a service then you can use the sc command for which I also provided links.

    If you want to do it all in code, see
    http://www.codeproject.com/Articles/...indows-Service

    There is also the program srvany.exe that be used. See
    http://support.microsoft.com/kb/137890
    http://stackoverflow.com/questions/2...n-as-a-service
    http://stackoverflow.com/questions/2...ws-2012-server
    Last edited by 2kaud; January 27th, 2015 at 08:17 AM.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

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

    Re: how to register an exe file in windows startup service routine

    Quote Originally Posted by Jeevan Rudramurthy View Post
    i want to register an helloworld.exe in service routine
    Then you should start wanting to create an exe able to run service mode. Regular exe is not able to do that.

    You start here with understanding Windows Service basics: About Services
    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