By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,676 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,676 IT Pros & Developers. It's quick & easy.

Automatic starting of program on reboot

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.