Windows natively has the NET USER command to perform a number of account related operations. For example, in order to effectively restrict access to your PC for a particular account based on timings, you can make use of NET USER command with the following syntax
Excerpt from Microsoft KB: http://support.microsoft.com/kb/251394
/times:{times | all}
Is the logon hours. The times option is expressed as day[-day][,day[-day]],time[-time][,time [-time]], and is limited to 1-hour increments. Days can be spelled out or abbreviated. Hours can be 12-hour or 24-hour notation. For 12-hour notation, use am, pm, a.m., or p.m. The all option specifies that a user can always log on, and a blank value specifies that a user can never log on. Separate day and time entries with a comma, and separate multiple day and time entries with a semicolon.
The above sounds rather confusing at best. Here are some examples to help you understand how to use the command:
Sample Usage
- net user Aloysious /time:M-F,08:00-17:00
- net user Aloysious /time:M-F,8am-5pm
- net user Aloysious /time:M,4am-5pm;T,1pm-3pm;W-F,8:00-17:00
- net user Aloysious /time:all (this allows user to logon at any time, on any day)
How to?
- Go to command prompt from Start > Run and type “cmd”(without quotes)
- Type any one of the appropriate net user command to restrict the user to a certain time frame and allowed days.
Note: The time is limited to one hour increment, which means you can only restrict the user by one-one hour (like 13:00, 16:00, not 13:30 or 16:45). You can use the abbreviation for the day (that is, M,T,W,Th,F,Sa,Su)