program to open multiple software applications which are installled in my system,autamatically when i SWITCH ON my PC.

Posted on 2004-11-28
Last Modified: 2012-05-05

I am having four softwares(w,x,y,z) in my system.

If I want to open these softwares,I have to click on each software to open.But,what I want is a C code such that,
with this C code all the four softwares should open automatically with 10 or 20 seconds gap when ever I switch on the system with out any clicks.

Example,its like when ever we switch on the system,MSN messenger or some other softwares will open automatically.

Thanks for your reply,

Question by:vihar123
    LVL 3

    Accepted Solution

    Windows has an API call WinExec that will launch an application and return immediately leaving the app running.
    You can just use sleep between the calls.
    Then put your program in the startup menu.

    If you would rather not write code you could use a batch file but there is no sleep function by default so you would need to download it from the Resource Kit or use "@ping -n TIMETOSLEEP -w 1000" where time to sleep is the number of seconds to delay+2.

    LVL 50

    Expert Comment

    by:Julian Hansen
    Does this have to be in code?

    Can you not use the RUN key in the registry or the Startup folder in your Profile or the All Users Profile? This is how MSN starts.


    "SomeKeyCanBeCalledAnything"="C:\Program Files\Program_You_Want_To_Launch"

    Or alternatively create a short cust to the file and put in

    C:\Documents and Settings\<your user profile>\programs\start menu\startup
    C:\Documents and Settings\all users\programs\start menu\startup

    Which options you choose depends on if you want the apps to launch for every user or just for yourself.

    LVL 3

    Expert Comment


    Is there a way to specify the sequence of starting applications using either the registry or startup folder?  I have never been able to figure out how to get things to run in a specific sequence using these but it would let me get rid of a bunch of batch files ;-)
    LVL 50

    Assisted Solution

    by:Julian Hansen

    What you could do is put all the applications you want to sequence in 1 bat / cmd file and then launch the bat / cmd from the registry / start up folder etc


    start /w myfirstprog.exe
    start mysecondprog.exe ' To run asynch
    start /w mythirdprog.exe

    Save to myprogs.bat

    Now - where to call this from.

    I did some tests some time ago to determine the order in which processes where run from the various startup locations in Windows and this is what I found

    1. Logon Script
    2. HKEY_LOCAL_MACHINE -> Run command in the order the keys were created
    3. Personal Startup folder
    4. All Users Startup folder
    5. HKEY_CURRENT_USER -> Run command in the order the keys were created

    So, if you don't use a logon script then you can put it in the HKLM Run command but you will need to delete all the other entries first (or export them to a file) then create the key for your file and then bring the others back in again.

    That may work.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now