3

I have an 8-year-old son, who likes to spend too much time playing computer games and browsing the internet. I have allowed him an hour of computer time in the morning and an hour in the evening. However, I can't be there all the time to watch if he keeps to our agreement.

What could I do to make the computer automatically close after X minutes. I don't want a solution, where you have to put a time, like 10:30AM for when the computer closes. I want to be able to start a kind of timer from when he logs on and then make it shut down or lock the computer after X minutes.

I have a Windows 7.

6
  • @Dave This answer Command-line (cmd) command to lock a windows machine shows you how to do it using a batch file that can be executed from the task scheduler with a log on trigger.
    – DavidPostill
    Commented Aug 18, 2017 at 7:52
  • 1
    @DavidPostill IMO this isn't a duplicate question. Another question happening to have an applicable answer doesn't necessarily mean the question was asking the same thing. In this particular case, this question invites more potential answers than just "command to lock a machine", e.g. Dave's suggestion of parental controls. Scheduled locking also does not necessarily have to involve the command line.
    – Bob
    Commented Aug 18, 2017 at 8:01
  • @DavidPostill In fact, that answer is a particularly bad example. It doesn't address "time after login" but only "on idle", and, more importantly, it pops up a cmd window that the user can close, thereby avoiding the lockout. Which makes it completely inapplicable to this question without significant modification.
    – Bob
    Commented Aug 18, 2017 at 8:13
  • 1
    @Bob Fair enough.Reopened.
    – DavidPostill
    Commented Aug 18, 2017 at 8:14
  • may help: superuser.com/a/1186786/3588
    – CAD bloke
    Commented Feb 19, 2019 at 9:17

1 Answer 1

4

I can think of 2 native solutions here.

Task scheduler will do what you want but I feel this is going to be very limited (although it may suffice).

Create a new task and in the New Trigger options choose

Begin the task : At log in

Then

Delay the task for N minutes

The action is to restart! There are 2 ways to do this...

  1. Open notepad, and type in shutdown -s -t 60. Save this is as restart.bat (note, it's .bat, not .txt). Then when you set the action in task scheduler, choose this file. This should also give your son a message that the computer is going to close in 60 seconds (change this value to give more or less time)

  2. You can choose one of the actions to run shutdown.exe and provide the parameters

This of course isn't really a perfect solution, as you're not considering what happens if your son pauses the game to do extra house work like washing the dishes as it will still be within this alloted time. It also doesn't consider that your son could cancel the shutdown command, or can just re-log on, but I get the impression this isn't a parenting issue, more of a "reminder" to help him!

You may also need to consider state - although he has a reminder that it will shut in 60 seconds, it may not be enough if he is part way through a game and has to reach a saving point, or there are multiple applications open where each needs to be saved etc


I think those using Windows 10 can use use parent controls for what you describe as it will provide ways to limit the amnount of time by application. It may also provide enough of a hint to see if 3rd party solutions exist for Windows 10

https://www.howtogeek.com/225323/how-to-add-and-monitor-a-childs-account-in-windows-10/

Those on Windows 7 have some control http://www.dummies.com/computers/operating-systems/windows-7/how-to-activate-parental-controls-in-windows-7/ although this seems limited


There are software tools for this type of thing as well but I'd suggest you ask at https://softwarerecs.stackexchange.com (just don't cross post).

1
  • 1
    You don't even need the .bat file -- you should be able to run shutdown.exe directly and provide the arguments in the arguments box directly in the task action.
    – Bob
    Commented Aug 18, 2017 at 8:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .