Skip to main content
added 26 characters in body
Source Link

In case someone don'tdoesn't want to set up parental control (someone wantwants to lock the computer from themselves, not their kids), here is another solution useusing only Task Scheduler, which I'm currently using:

  1. Start menu --> Type "Task Scheduler" --> Open Task Scheduler.
  2. Create New Task
  3. Set these properties in the General tab:
  • Name: choose a task name
  • Check Run only when user is logged on
  1. In the Triggers tab:
  • "New..."
  • Beginning the task: On a schedule
  • Settings: Daily
  • Set the hour you want to turn off your computer
  • Check Repeat task every: 5 minutes for a duration of 1 hours (or 8-9 hours, dependdepending on you)
  • Check Stop all running tasks at end of repetition duration
  • Check Enabled
  • OK
  1. In the Actions tab:
  • "New..."
  • Action: Start a program
  • Program/script: powershell.exe
  • Add agurmentargument: -command add-type -assemblyname System.Windows.Forms; [System.Windows.Forms.Application]::SetSuspendState([System.Windows.Forms.PowerState]::Suspend, $false, $false)
  1. In the Conditions tab:
  • Uncheck everything
  1. In the Settings tab:
  • Uncheck everything

This schedule will sleepput your computer to sleep at the chosen time. If you try to turn the computer back on, it will continue to sleep every 5 minutes (in 1 or 9 hours - dependdepending on your setup). This sleep action cannot be preventprevented. The computer went sleep, not turn off, so no worry about unsaved work.

Note: there is no warning display before the computer gogoes to sleep. You can create another Task Schedule to remind you of sleep time.

In case someone don't want to set up parental control (someone want to lock the computer from themselves, not their kids), here is another solution use only Task Scheduler, which I'm currently using:

  1. Start menu --> Type "Task Scheduler" --> Open Task Scheduler.
  2. Create New Task
  3. Set these properties in the General tab:
  • Name: choose a task name
  • Check Run only when user is logged on
  1. In the Triggers tab:
  • "New..."
  • Beginning the task: On a schedule
  • Settings: Daily
  • Set the hour you want to turn off your computer
  • Check Repeat task every: 5 minutes for a duration of 1 hours (or 8-9 hours, depend on you)
  • Check Stop all running tasks at end of repetition duration
  • Check Enabled
  • OK
  1. In the Actions tab:
  • "New..."
  • Action: Start a program
  • Program/script: powershell.exe
  • Add agurment: -command add-type -assemblyname System.Windows.Forms; [System.Windows.Forms.Application]::SetSuspendState([System.Windows.Forms.PowerState]::Suspend, $false, $false)
  1. In the Conditions tab:
  • Uncheck everything
  1. In the Settings tab:
  • Uncheck everything

This schedule will sleep your computer at chosen time. If you try to turn the computer back on, it will continue to sleep every 5 minutes (in 1 or 9 hours - depend on your setup). This sleep action cannot be prevent. The computer went sleep, not turn off, so no worry about unsaved work.

Note: there is no warning display before the computer go to sleep. You can create another Task Schedule to remind you of sleep time.

In case someone doesn't want to set up parental control (someone wants to lock the computer from themselves, not their kids), here is another solution using only Task Scheduler, which I'm currently using:

  1. Start menu --> Type "Task Scheduler" --> Open Task Scheduler.
  2. Create New Task
  3. Set these properties in the General tab:
  • Name: choose a task name
  • Check Run only when user is logged on
  1. In the Triggers tab:
  • "New..."
  • Beginning the task: On a schedule
  • Settings: Daily
  • Set the hour you want to turn off your computer
  • Check Repeat task every: 5 minutes for a duration of 1 hours (or 8-9 hours, depending on you)
  • Check Stop all running tasks at end of repetition duration
  • Check Enabled
  • OK
  1. In the Actions tab:
  • "New..."
  • Action: Start a program
  • Program/script: powershell.exe
  • Add argument: -command add-type -assemblyname System.Windows.Forms; [System.Windows.Forms.Application]::SetSuspendState([System.Windows.Forms.PowerState]::Suspend, $false, $false)
  1. In the Conditions tab:
  • Uncheck everything
  1. In the Settings tab:
  • Uncheck everything

This schedule will put your computer to sleep at the chosen time. If you try to turn the computer back on, it will continue to sleep every 5 minutes (in 1 or 9 hours - depending on your setup). This sleep action cannot be prevented. The computer went sleep, not turn off, so no worry about unsaved work.

Note: there is no warning display before the computer goes to sleep. You can create another Task Schedule to remind you of sleep time.

Source Link

In case someone don't want to set up parental control (someone want to lock the computer from themselves, not their kids), here is another solution use only Task Scheduler, which I'm currently using:

  1. Start menu --> Type "Task Scheduler" --> Open Task Scheduler.
  2. Create New Task
  3. Set these properties in the General tab:
  • Name: choose a task name
  • Check Run only when user is logged on
  1. In the Triggers tab:
  • "New..."
  • Beginning the task: On a schedule
  • Settings: Daily
  • Set the hour you want to turn off your computer
  • Check Repeat task every: 5 minutes for a duration of 1 hours (or 8-9 hours, depend on you)
  • Check Stop all running tasks at end of repetition duration
  • Check Enabled
  • OK
  1. In the Actions tab:
  • "New..."
  • Action: Start a program
  • Program/script: powershell.exe
  • Add agurment: -command add-type -assemblyname System.Windows.Forms; [System.Windows.Forms.Application]::SetSuspendState([System.Windows.Forms.PowerState]::Suspend, $false, $false)
  1. In the Conditions tab:
  • Uncheck everything
  1. In the Settings tab:
  • Uncheck everything

This schedule will sleep your computer at chosen time. If you try to turn the computer back on, it will continue to sleep every 5 minutes (in 1 or 9 hours - depend on your setup). This sleep action cannot be prevent. The computer went sleep, not turn off, so no worry about unsaved work.

Note: there is no warning display before the computer go to sleep. You can create another Task Schedule to remind you of sleep time.