Skip to content

Instantly share code, notes, and snippets.

@ilansmith
Last active June 15, 2019 04:35
Show Gist options
  • Save ilansmith/0539884ebe57caba45a11a3453697798 to your computer and use it in GitHub Desktop.
Save ilansmith/0539884ebe57caba45a11a3453697798 to your computer and use it in GitHub Desktop.
Set Windows 10 local user time restrictions
@echo off
set MORNING=6:00am-8:00am
set SCHOOL=8:00am-1:00pm
set AFTERNOON=1:00pm-6:00pm
set EVENING=6:00pm-12:00am
set NIGHT=12:00am-6:00am
set LIMIT=SU-SA,%AFTERNOON%;F,%EVENING%;SA,%MORNING%,%SCHOOL%
rem echo MORNING:%MORNING%
rem echo SCHOOL:%SCHOOL%
rem echo AFTERNOON:%AFTERNOON%
rem echo EVENING:%EVENING%
rem echo NIGHT:%NIGHT%
rem echo LIMIT=%LIMIT%
echo Setting time restriction for user: %1 to %LIMIT%
net user %1 /time:%LIMIT%
net user %1
@echo on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment