?
Solved

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

Posted on 2004-11-28
6
Medium Priority
?
191 Views
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,

Regards,
0
Comment
Question by:vihar123
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
jeiler earned 1000 total points
ID: 12690227
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 127.0.0.1 -n TIMETOSLEEP -w 1000" where time to sleep is the number of seconds to delay+2.



0
 
LVL 61

Expert Comment

by:Julian Hansen
ID: 12690619
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.

Registry

HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
\Software\Microsoft\Windows\CurrentVersion\Run
"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
or
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.

0
 
LVL 3

Expert Comment

by:jeiler
ID: 12696183
julianH,

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 ;-)
Thanks.
0
 
LVL 61

Assisted Solution

by:Julian Hansen
Julian Hansen earned 1000 total points
ID: 12715357
Yes,

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

Example

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.

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

607 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