Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

How to start app at startup ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kunal - 21 Feb 2007 15:02 GMT
Hi friends,

I'm faced with a requirement that is kind of unknown to me.

In my situation, if my application was running and the machine
reboots, then I need to start my
application automatically once the machine comes up. If the
application was closed by the user
then it should not come up at system reboot next time.

One way to do this could be to write a small program which reads a
"status" from a file which
will be written to by the application while it is running. The app
would write "Running" when it is executing or "Not Running" when it is
closed, to this file. I could then install this program as a windows
service to start up automatically at reboot time. There it would check
up the
contents of the status file and take appropriate action.

I've heard this can also be achieved through some registry work.

Are there any other ways of doing this ? What would be the best,
easiest and efficent way
of doing this ?

Thanks n Regards,
Kunal
Michael Nemtsev - 21 Feb 2007 19:57 GMT
Hello kunal,

k> I'm faced with a requirement that is kind of unknown to me.
k>
k> In my situation, if my application was running and the machine
k> reboots, then I need to start my
k> application automatically once the machine comes up. If the
k> application was closed by the user
k> then it should not come up at system reboot next time.

When your app starts put the record at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

which run your app after next logon.
If user gracefully close you app just remove that record.

Other way to load app automatically is create shortcut to you app in Startup
folder

---
WBR,  Michael  Nemtsev [C# MVP].  
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.