You are here:

C++/automatic execution on startup ...


Hello sir!

I have a very simple question:

how can I write a program that when installed, automatically executes on atart up; Something like antivirus programs that whenever the windows starts up they automatically go to win-tray.

Note that I do not want to use StartUp folder, ".\Documents and Settings\...\Start Menu\Programs\Startup".

Also I want my program to automatically go to the win-tray.

thank you very much.

mohammad, Thank you for your question.

This does not appear to be a question about the C++ programming language. Perhaps you made a mistake in selecting the question topic area.

It sounds like you want to write a program that runs on the user's computer "in the background" rather than under the direct control of the user. Such a process is called a Service, and is supported somewhat differently on different versions of Windows.

Services are documented in Microsoft's MSDN Library. You can search the MSDN Library at

Let me know if you have any further questions.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2016 All rights reserved.