473,836 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2022
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.co m

"Peter S." <Pe****@discuss ions.microsoft. com> wrote in message
news:59******** *************** ***********@mic rosoft.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.co m

"Peter S." <Pe****@discuss ions.microsoft. com> wrote in message
news:59******** *************** ***********@mic rosoft.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.co m

"Peter S." <Pe****@discuss ions.microsoft. com> wrote in message
news:59******** *************** ***********@mic rosoft.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.co m

"Peter S." <Pe****@discuss ions.microsoft. com> wrote in message
news:59******** *************** ***********@mic rosoft.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.co m

"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:23******** *************** ***********@mic rosoft.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.co m
>
> "Peter S." <Pe****@discuss ions.microsoft. com> wrote in message
> news:59******** *************** ***********@mic rosoft.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****@discuss ions.microsoft. com> wrote in message
news:72******** *************** ***********@mic rosoft.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.i ni - [boot] "shell"
8 . windir\system.i ni - [boot] "scrnsave.e xe"
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\a utoexec.nt
11. windir\system\c onfig.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.co m
>
> "Peter S." <Pe****@discuss ions.microsoft. com> wrote in message
> news:59******** *************** ***********@mic rosoft.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
6974
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 logged in my alert file for the shutdown or startup, however, the databases are down and when I manually start them up, the alert log reveals a crash recovery. I've verified the settings in the registry for automatic shutdown and startup. I've...
4
1890
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 automatically started ? but next to it the start mode does say 'automatic' instead of manual. so how I get it to start after every reboot ? Thanks
2
1920
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 watchDog circuit. This ckt will be interfaced on LPT1's pin 16/14 . There will be software 'C' program which will continually send 01010.. on the pin on LPT1 . Now ckt is made with a logic that it will observe the square wave ie 010101...on...
4
4433
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 automatically started ? but next to it the start mode does say 'automatic' instead of manual. so how I get it to start after every reboot ? Thanks
2
3137
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 via regedit.exe. However when I make the changes with the code below those changed are NOT reflected in the control panel applet even though they are actully being set. Does anyone have any experience with this?
3
3191
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 following line. m_pFileLogAppender = new FileLogAppender(severity, logFile);
3
1700
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 AM with an unhandled exception on the screen. As best I can tell this exception occurs while it's trying to reboot the pc. This has me thinking it might be nice to have it do a reboot whenever it has an unhandled exception but then again I'm...
0
1484
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
2799
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 automatically memoized. Is it due to caching of return values or something else? The point is, does this program exhibit some property which leads to automatic memoization by the compiler? Which can be satisfied by other programs too to make them...
0
9820
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9670
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4452
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4016
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3115
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.