Launch the Application on windows startup like MSN Messenger
-
-
hi i m developing a simple application in C# and i want to know that how can we launch the application on the statup of windows like msn messenger do.so that when we boot the windows it start our application. i m using Windows XP. thanks for your help.
Do you want it like MSN Messenger (where it launches when someone logs on) or do you want a service that launches when the machine comes up (regardless if someone logs on or not)?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins -
hi i m developing a simple application in C# and i want to know that how can we launch the application on the statup of windows like msn messenger do.so that when we boot the windows it start our application. i m using Windows XP. thanks for your help.
You can either install a shortcut into the All Users' or a specific user's Start Menu->Programs->Startup folder, or install a registry key into either HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE under the key Software\Microsoft\Windows\CurrentVersion\Run.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Do you want it like MSN Messenger (where it launches when someone logs on) or do you want a service that launches when the machine comes up (regardless if someone logs on or not)?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins -
i want it to comes up when machine comes up regardless of if someone logs on or not. thank you
Then you want to create a Windows Service. The wizard inside VS.Net has a wizard for windows services, and that's a good place to start. You'll basically be creating a class that derives from System.ServiceProcess.ServiceBase. You'll also have to add an installer component (System.Configuration.Install.Installer) for your service and run "installutil" to get your service properly installed. Services are not that hard to create, but they're a bit of a pain to debug. I recommend you find a good article on them somewhere to get started. A lot of people end up creating a class that they contain first in a normal console application for debugging purposes. They later contain that class in their service when they feel like it's been debugged a good amount. Hope that helps a bit.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins -
hi i m developing a simple application in C# and i want to know that how can we launch the application on the statup of windows like msn messenger do.so that when we boot the windows it start our application. i m using Windows XP. thanks for your help.
You could also open Regedit.exe. Go to "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run". Add a String Value. Set it's name to whatever you want. Let it's value point to the pad of the program you want to run. Enter something like: "c:\windows\explorer.exe ??" where ?? are optional commandline-arguments you would want to use. While this key is originally designed for Win9x it should also work on XP. At least it works on my XP-version. Of course you could also add such a value by using a .reg file or you could let the installer you use for deploying you application do this for you. I'm not shure whether or not someone needs to log on first before the application gets started, but it works for all users. I hope this helps. Roland.