Solved

Repost: Order of Start Up Applications

Posted on 1998-11-30
5
182 Views
Last Modified: 2013-12-28
This is a repost of my earlier question: Order of Start Up Applications.  Please submit your comments, and I will issue a message to the most suitable answerer to then obtain the points.

Thanks

Tom
0
Comment
Question by:McDorman
5 Comments
 
LVL 3

Expert Comment

by:linschoten
ID: 1648147
I think you can order the startup by moving the icons. However you can either run the jobs from a batch file and put a shortcut to the batch file in the startup group or you can run the individual programs from the RUN and/or LOAD commands in the WIN.INI file

0
 
LVL 3

Expert Comment

by:arunm
ID: 1648148
Ok here I go again:-

Writing a utility to start programs in a particular order, and then pausing between the start of each program to ensure they appear in the correct order, is pretty easy. The follow program takes a list of program paths and delays as arguments. The easiest method to use it is to place a shortcut to this program in the startup directory with the correct target info. For example;-

A target string could look like.

c:\myprogs\thisprogram.exe c:\program files\first_program.exe 2 c:\program files\second_program.exe 3 c:\program files\third_program.exe 0

This would start c:\program files\first_program.exe wait 2 secs, then start  c:\program files\second_program.exe wait 3 secs and then finally start c:\program files\third_program.exe

If you dont have a vc++ complier I can email you a working version of
this. Or if you need any more help on how to use it, let me know.

    #include <afx.h>
    #include <iostream.h>
    #include <winbase.h>
    #include <process.h>


    int main(int argc, char *argv[])
    {
     PROCESS_INFORMATION ProcessInfo;
     STARTUPINFO  InfoToPass;
     int   seconds;
     int   currentArg = 1;



     // Initialise Startup structure
     InfoToPass.cb = sizeof(InfoToPass);
     InfoToPass.lpReserved = NULL;
     InfoToPass.lpDesktop = NULL;
     InfoToPass.lpTitle = NULL;
     InfoToPass.dwFlags = STARTF_USESHOWWINDOW;
     InfoToPass.cbReserved2 = 0;
     InfoToPass.lpReserved2 = NULL;
     InfoToPass.wShowWindow = SW_SHOWNORMAL;

     // Spawn required process as a normal process

     while (currentArg < argc)
     {
      // You could also use winexec here, but i prefer the control achived using
      CreateProcess(argv[currentArg++], "", NULL, NULL, FALSE,
       CREATE_NEW_CONSOLE, NULL, NULL, &InfoToPass, &ProcessInfo);


      sscanf(argv[currentArg++],"%d", &seconds);

       // wait
      Sleep(seconds * 1000);
     }

     return (0);

    }


Note:- I prefer to use createprocess() over winexec() due to the additional control it gives you over the process. Also, replacing  SW_SHOWNORMAL with SW_SHOWMINISMED allows an application to start minimsed on the task bar. It would be quite simple to add this to the list of arguments at start up.
0
 
LVL 2

Expert Comment

by:rlippert
ID: 1648149
actually a program already exists to do just that and is freeware.  Its called DoWinStartup and is available at
http://www.mrdo.com/dowinstartup
has alot of other cool features (like delayed loading of programs) and is much beter than writing your own program IMHO.
0
 

Author Comment

by:McDorman
ID: 1648150
I'm going to reject this answer due to 2 other better answers.  rlippert would you please post your comment as an answer to this question.  Arunm, I'll give your answer the points on the original answer to this question.

Although both your answers were very good, I took my wife's computer off the ISDN network and gave her a regular modem, which works well from within Outlook itself.

Thanks

Tom
0
 
LVL 2

Accepted Solution

by:
rlippert earned 50 total points
ID: 1648151
ok, thanks...
0

Featured Post

Want to promote your upcoming event?

Is your company attending an event or exhibiting at a trade show soon? Are you speaking at a conference? Spread the word by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

Join & Write a Comment

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

708 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

15 Experts available now in Live!

Get 1:1 Help Now