473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Automatic starting of program on reboot

I currently have created a C# program that automatically updates
an SQL database once everyday. It's an application that I manually
start. I want make it so that if the (Windows 2003) server reboots
the program automatically starts up. What's the best method to
do this? Creating a service I guess would be one option????

BTW, I have created other programs that ran on a daily basis by having
them run as a scheduled task job. However I don't really want to do
that this time. I like the fact this is an app and I can post messages
in a textbox and allow the user control on when the nightly task runs.
Any ideas on how best to accomplish this?
Jun 5 '06 #1
7 1989
Peter,

This might be something that is suited for a service then. This way,
you can have the service start on startup, and you can perform your task.

Normally, for something like this, I would recommend making it a
scheduled task. However, you want to stay away from that. If that is the
case, then you will really need to handle the scheduling task yourself.

A service would be the simplest way to do this, since you could just
pause the service when you don't want it to run. If you want a front-end to
your task, then expose an object through remoting and then have a client on
the front end connect to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
I currently have created a C# program that automatically updates
an SQL database once everyday. It's an application that I manually
start. I want make it so that if the (Windows 2003) server reboots
the program automatically starts up. What's the best method to
do this? Creating a service I guess would be one option????

BTW, I have created other programs that ran on a daily basis by having
them run as a scheduled task job. However I don't really want to do
that this time. I like the fact this is an app and I can post messages
in a textbox and allow the user control on when the nightly task runs.
Any ideas on how best to accomplish this?

Jun 5 '06 #2
Excellent, thanks very much! What is the prescribed method for installing
something as a service? I suspect there are some registry entries that need
to be made?

Also I was just looking at some other services and acccessing the app may
not be that bad. There is an option to log on as the Local System Account
(which is what I had planned) and a checkbox to allow the service to interact
with the desktop. I noticed another service where this checkbox was selected
and the app showed up in the system tray. I am guessing the same thing would
occur for my app?

"Nicholas Paldino [.NET/C# MVP]" wrote:
Peter,

This might be something that is suited for a service then. This way,
you can have the service start on startup, and you can perform your task.

Normally, for something like this, I would recommend making it a
scheduled task. However, you want to stay away from that. If that is the
case, then you will really need to handle the scheduling task yourself.

A service would be the simplest way to do this, since you could just
pause the service when you don't want it to run. If you want a front-end to
your task, then expose an object through remoting and then have a client on
the front end connect to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
I currently have created a C# program that automatically updates
an SQL database once everyday. It's an application that I manually
start. I want make it so that if the (Windows 2003) server reboots
the program automatically starts up. What's the best method to
do this? Creating a service I guess would be one option????

BTW, I have created other programs that ran on a daily basis by having
them run as a scheduled task job. However I don't really want to do
that this time. I like the fact this is an app and I can post messages
in a textbox and allow the user control on when the nightly task runs.
Any ideas on how best to accomplish this?


Jun 5 '06 #3
Peter,
if you simply want this program to run when the machine boots up, why not
just put a shortcut to it in the Startup Program Files folder?

--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter S." wrote:
Excellent, thanks very much! What is the prescribed method for installing
something as a service? I suspect there are some registry entries that need
to be made?

Also I was just looking at some other services and acccessing the app may
not be that bad. There is an option to log on as the Local System Account
(which is what I had planned) and a checkbox to allow the service to interact
with the desktop. I noticed another service where this checkbox was selected
and the app showed up in the system tray. I am guessing the same thing would
occur for my app?

"Nicholas Paldino [.NET/C# MVP]" wrote:
Peter,

This might be something that is suited for a service then. This way,
you can have the service start on startup, and you can perform your task.

Normally, for something like this, I would recommend making it a
scheduled task. However, you want to stay away from that. If that is the
case, then you will really need to handle the scheduling task yourself.

A service would be the simplest way to do this, since you could just
pause the service when you don't want it to run. If you want a front-end to
your task, then expose an object through remoting and then have a client on
the front end connect to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
I currently have created a C# program that automatically updates
an SQL database once everyday. It's an application that I manually
start. I want make it so that if the (Windows 2003) server reboots
the program automatically starts up. What's the best method to
do this? Creating a service I guess would be one option????

BTW, I have created other programs that ran on a daily basis by having
them run as a scheduled task job. However I don't really want to do
that this time. I like the fact this is an app and I can post messages
in a textbox and allow the user control on when the nightly task runs.
Any ideas on how best to accomplish this?


Jun 5 '06 #4
Doesn't this require someone to log in for that to get kicked off? If not
is that instance of the program accessible to subsequent users who log on?

"Peter Bromberg [C# MVP]" wrote:
Peter,
if you simply want this program to run when the machine boots up, why not
just put a shortcut to it in the Startup Program Files folder?

--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter S." wrote:
Excellent, thanks very much! What is the prescribed method for installing
something as a service? I suspect there are some registry entries that need
to be made?

Also I was just looking at some other services and acccessing the app may
not be that bad. There is an option to log on as the Local System Account
(which is what I had planned) and a checkbox to allow the service to interact
with the desktop. I noticed another service where this checkbox was selected
and the app showed up in the system tray. I am guessing the same thing would
occur for my app?

"Nicholas Paldino [.NET/C# MVP]" wrote:
Peter,

This might be something that is suited for a service then. This way,
you can have the service start on startup, and you can perform your task.

Normally, for something like this, I would recommend making it a
scheduled task. However, you want to stay away from that. If that is the
case, then you will really need to handle the scheduling task yourself.

A service would be the simplest way to do this, since you could just
pause the service when you don't want it to run. If you want a front-end to
your task, then expose an object through remoting and then have a client on
the front end connect to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
>I currently have created a C# program that automatically updates
> an SQL database once everyday. It's an application that I manually
> start. I want make it so that if the (Windows 2003) server reboots
> the program automatically starts up. What's the best method to
> do this? Creating a service I guess would be one option????
>
> BTW, I have created other programs that ran on a daily basis by having
> them run as a scheduled task job. However I don't really want to do
> that this time. I like the fact this is an app and I can post messages
> in a textbox and allow the user control on when the nightly task runs.
> Any ideas on how best to accomplish this?

Jun 5 '06 #5
That won't run when the machine starts up. That will run when the user
logs in interactively. No one might log into the machine when the machine
starts up.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:23**********************************@microsof t.com...
Peter,
if you simply want this program to run when the machine boots up, why not
just put a shortcut to it in the Startup Program Files folder?

--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter S." wrote:
Excellent, thanks very much! What is the prescribed method for installing
something as a service? I suspect there are some registry entries that
need
to be made?

Also I was just looking at some other services and acccessing the app may
not be that bad. There is an option to log on as the Local System Account
(which is what I had planned) and a checkbox to allow the service to
interact
with the desktop. I noticed another service where this checkbox was
selected
and the app showed up in the system tray. I am guessing the same thing
would
occur for my app?

"Nicholas Paldino [.NET/C# MVP]" wrote:
> Peter,
>
> This might be something that is suited for a service then. This
> way,
> you can have the service start on startup, and you can perform your
> task.
>
> Normally, for something like this, I would recommend making it a
> scheduled task. However, you want to stay away from that. If that is
> the
> case, then you will really need to handle the scheduling task yourself.
>
> A service would be the simplest way to do this, since you could
> just
> pause the service when you don't want it to run. If you want a
> front-end to
> your task, then expose an object through remoting and then have a
> client on
> the front end connect to it.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Peter S." <Pe****@discussions.microsoft.com> wrote in message
> news:59**********************************@microsof t.com...
> >I currently have created a C# program that automatically updates
> > an SQL database once everyday. It's an application that I manually
> > start. I want make it so that if the (Windows 2003) server reboots
> > the program automatically starts up. What's the best method to
> > do this? Creating a service I guess would be one option????
> >
> > BTW, I have created other programs that ran on a daily basis by
> > having
> > them run as a scheduled task job. However I don't really want to do
> > that this time. I like the fact this is an app and I can post
> > messages
> > in a textbox and allow the user control on when the nightly task
> > runs.
> > Any ideas on how best to accomplish this?
>
>
>

Jun 5 '06 #6

"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
| Doesn't this require someone to log in for that to get kicked off? If not
| is that instance of the program accessible to subsequent users who log on?
|

Sure it does, but you want your Service to interact with the desktop (which
is bad practice), so you need an interactive logon anyway.

Willy.
Jun 5 '06 #7
Yep, didn't catch that in your post. Just for the sake of completeness,
The following are files that programs can autostart from on bootup:

1. c:\autoexec.bat
2. c:\config.sys
3 . windir\wininit.ini - Usually used by setup programs to have a file run
once and then get deleted.
4. windir\winstart.bat
5. windir\win.ini - [windows] "load"
6. windir\win.ini - [windows] "run"
7. windir\system.ini - [boot] "shell"
8 . windir\system.ini - [boot] "scrnsave.exe"
9. windir\dosstart.bat - Used in Win95 or 98 when you select the "Restart in
MS-DOS mode" in the shutdown menu.
10. windir\system\autoexec.nt
11. windir\system\config.nt

In addition, there are a whole slew of registry keys that can be set, some
of which also will run the specified program on boot, and before anyone logs
on.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter S." wrote:
Doesn't this require someone to log in for that to get kicked off? If not
is that instance of the program accessible to subsequent users who log on?

"Peter Bromberg [C# MVP]" wrote:
Peter,
if you simply want this program to run when the machine boots up, why not
just put a shortcut to it in the Startup Program Files folder?

--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter S." wrote:
Excellent, thanks very much! What is the prescribed method for installing
something as a service? I suspect there are some registry entries that need
to be made?

Also I was just looking at some other services and acccessing the app may
not be that bad. There is an option to log on as the Local System Account
(which is what I had planned) and a checkbox to allow the service to interact
with the desktop. I noticed another service where this checkbox was selected
and the app showed up in the system tray. I am guessing the same thing would
occur for my app?

"Nicholas Paldino [.NET/C# MVP]" wrote:

> Peter,
>
> This might be something that is suited for a service then. This way,
> you can have the service start on startup, and you can perform your task.
>
> Normally, for something like this, I would recommend making it a
> scheduled task. However, you want to stay away from that. If that is the
> case, then you will really need to handle the scheduling task yourself.
>
> A service would be the simplest way to do this, since you could just
> pause the service when you don't want it to run. If you want a front-end to
> your task, then expose an object through remoting and then have a client on
> the front end connect to it.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Peter S." <Pe****@discussions.microsoft.com> wrote in message
> news:59**********************************@microsof t.com...
> >I currently have created a C# program that automatically updates
> > an SQL database once everyday. It's an application that I manually
> > start. I want make it so that if the (Windows 2003) server reboots
> > the program automatically starts up. What's the best method to
> > do this? Creating a service I guess would be one option????
> >
> > BTW, I have created other programs that ran on a daily basis by having
> > them run as a scheduled task job. However I don't really want to do
> > that this time. I like the fact this is an app and I can post messages
> > in a textbox and allow the user control on when the nightly task runs.
> > Any ideas on how best to accomplish this?
>
>
>

Jun 5 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Lynn | last post by:
I'm running Oracle 8.1.7.4.1 on W2K and have the services for my oracle instances set to automatically startup and shutdown with the W2K server. Unfortunately, neither is working. Nothing gets...
4
by: Tom | last post by:
Hi I've created a windows service and it is set to run under local system account. But after its installed and after reboot when I check in the services its still sitting there and have not...
2
by: mr_amitkulkarni | last post by:
Hello Friends, Objective : I'm working on a trivial solution for an issue like if my server/pc hangs at any moment it should reboot automatically. proposed Solution : I'll be using an external...
4
by: Tom | last post by:
Hi I've created a windows service and it is set to run under local system account. But after its installed and after reboot when I check in the services its still sitting there and have not...
2
by: Ty Moffett | last post by:
Below is a set of insructions that changes the registry keys pertaining to Automatic Updates on my Windows XP box. I can make changes using the control panel applet and see the changes reflected...
3
by: keepyourstupidspam | last post by:
Hi, I have written a service that can start and stop normally using net start and net stop but when I reboot the machine the serivce does not restart. The code seems to bomb out on the...
3
by: cj | last post by:
My program shuts itself down and reboots the pc it's running on at 2:00am twice a week and has been doing so without fail for over a year. But twice in the past month it's been found running in the...
0
by: s.kapitza | last post by:
Hi, try M$S servicebug 3 regards s.kapitza alghaden@alumni.fdu.edu (Ahmad) wrote in message news:<4a75f4b7.0308080649.49105373@posting.google.com>...
5
by: trss | last post by:
Has anyone experienced automatic memoization by any C++ compiler before? The program coded as a solution for the problem based on the famous 3n +1 problem, both of which are given below, is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.