Archived

This topic is now archived and is closed to further replies.

Computer Timer

This topic is 5578 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Boring Bit: I have recently put a PC in my sons room with a TV card and video, which he as immediatley abused by watching at rediculous hours. So i want to make a program that once the computer has booted will check the time and if its not valid, shut down the computer. I can do the time validation stuff, but do not know where to start with the program running on Boot-up or making the system shut down. Any help will be much appriciated, thanks

Share this post


Link to post
Share on other sites
Hi

look at these WinAPI functions:
InitiateSystemShutdown() and ExitWindowsEx()

Another way to shut the system down is to call rundll.exe with parameters "user.exe,exitwindows" that works on my Win98, not sure about newer windows version though





Runicsoft -- home of my open source Function Parser and more

Share this post


Link to post
Share on other sites
And if you want to ''hide'' the program (so it doesn''t have to be in the autostart folder) and call it at startup open regedit, go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
and add an entry for your program



Runicsoft -- home of my open source Function Parser and more

Share this post


Link to post
Share on other sites