Hi there,

I have joined this forum to ask lots of programming and hardware relevant questions. Well first one is this....

I am a C++ programmer. But I am trying to develop a program(.exe file) that will automatically run when I want to run it. Like I want to run it 1 am every night. So what is the library function for this and what is is syntax? I am using Turbo C/C++ compiler to write codes.

Please help me anybody.....

Recommended Answers

All 3 Replies

A program cannot start itself. You will need another program to start it for you. If you are using a standard operating system such as a *nix or Windows, a program to do that already exists.

Under *nix, look up "cron". Under Windows, look up "task scheduler". It will be much easier to use an already existing program to do this than write your own.

Alternatively, have your program always running, but just waiting and checking the time every minute or so until it's time to do whatever its task is.

Okay thanks for ur answer. In fact I was looking for more specific answer. I think using c++ programming language we can write a script and then integrate it with our main exe file. and then this script or exe file can start the main program when any condition fulfill.

Even though I am not 100% sure but can anybody tell me if anything like this exists.

I found Moschops' answer very spcific. Maybe you should read it again carefully?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.