I doesn't matter what holes you try and plug here, a user who really want's
to circumvent your intent is going to be able to do so.
One hole would be the user stopping the service then settting its startup
mode to manual or disabled. That will really do the trick.
So will the user uninstalling the service.
I think the user changing the clock would be the least of your worries.
If the user(s) shouldn't have permissions for changing settings on services
then maybe you should consider revoking their permissions for changing the
clock.
In my view, any user who changes the clock without having a justifiable
reason for doing so should be hung drawn and quartered. The only reason for
doing so is to do something that they shouldn't.
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:dd**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Thanks Phil, this is all very useful and gives me what I asked for.
Having slept on it I can see how it could easily be overcome by a user
i.e. just reset the internal clock! I was thinking if I have a thread that
checks the time every couple of minutes to see if its time to shutdown
maybe I need to get the time from the internet. or is there a better way
to plug this hole?
thanks
Adrian
"Phil" <Ph**@nospam.com> wrote in message
news:dd**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com... Hi,
You can do this using a timer, the win32 API and windows service from the
VS IDE. Creating a windows service is relatively easy. You need to add a
windows service from your project ( >Add New Item >Windows Service).
Switch to code view and you'll see a couple of subs for executing code on
start and stopping of the service. You will also need to add the
installer classes which can be done back in design view of the service.
Notice at the bottom of the properties window a hyperlink for installer.
Go from there.
As for the API, see
http://blogs.msdn.com/brad_mccabe/ar...02/383542.aspx
Good luck and let us know how you get on.
Rgds, Phil
"Adrian" <Ad****@nospamhotmail.com.uk> wrote in message
news:dd**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... Hi
is this possible in VB.Net ?
How should I go about it?
The Idea is the service will run at a given time and shutdown the PC no
matter what state it has been left in!
Any pointers would be helpful not written much and have never written a
service :(
OS XP
thanks