(Besides parental control, you can disable access to selected drives easily or even prevent others from copying your files to a USB storage device.)
From Windows Vista onwards, a parental control has been built into the Operating System by Microsoft. This is not the case with Windows XP though. Although there are many good third party software available for this purpose, here I am going to show you how you can add a simple time restriction for user login under Windows XP. The whole thing is very easy despite the documentation – just skip to the topicOur easy way
Contents
Time restriction is the most basic forms of parental control. There is a built in tool in Windows XP for the very same purpose. This is hidden under a command line interface though. Do not get taken back by command prompt, the trick is pretty easy.
Open Command Prompt
First you have to open a command prompt windows while you are logged into an administrator account. Press Windows + R to open the run dialog and then type “cmd“. (You can find out more shortcuts in – Keyboard shortcuts for Windows)
Using net user command
In the next step we will use the “net” command available only under command prompt for our purpose. The “net” command is one of the most powerful commands available on Windows. It lets you administer and automate many tasks in Windows. We will only use the sub-part specific to user account control. Here are some some details about the net user command (ignore this and skip to next section to find out the our easy way):
Net user
Adds or modifies user accounts or displays user account information.
Syntax
net user [UserName [Password | *] [options]] [/domain]
net user [UserName {Password | *} /add [options] [/domain]]
net user [UserName [/delete] [/domain]]
Parameters
UserName : Specifies the name of the user account to add, delete, modify, or view. The name of the user account can have as many as 20 characters.
Password : Assigns or changes a password for the user’s account. Type an asterisk (*) to produce a prompt for the password. The password is not displayed when you type it at the password prompt.
/domain : Performs the operation on the domain controller in the computer’s primary domain.
options : Specifies a command-line option. The following table lists valid command-line options that you can use.
You can read more about the command at Microsoft KB : Full options of net user command.
Using the Command
Do not get frightened by all those options. What we need to do is very simple. Just use
net user USER_NAME PASSWORD /times:Su-Sa,12-13;
net user USER_NAME PASSWORD /times:Su-Sa,3-15;Sa,15-16;
The first option restricts the time the user \”USERNAME\” with PASSWORD can log in from 12PM to 1PM on all days (Sunday through Saturday) (use 24 hour clock in the command its easier to read). The second command restricts the user USERNAME’s login time to 3AM to 3PM on all days and on Saturdays, allocates additional time from 3PM to 6PM.
net user USERNAME */PASSWORD /times in action
In the above screen shot, the command is used to restrict the user “limited” to login only from 1PM to 3PM on all week days. The * will make the command prompt for the users password.
Clear all restrictions
To clear all restrictions just type : net user USER_NAME PASSWORD/*] /times:all
Here is a screen shot of the error produced if the user tries to log in during restricted hours.
Error shown during restricted hours.
This is a brief summary about the net user commands on Microsoft Knowledge Base :
Other notes
Days can be spelled out or abbreviated. Time can be given in increments of 1 hour. You may enter the time in either 12-hour or 24-hour notation. For 12-hour notation, use am, pm, a.m., or p.m. The time can be specified in increments of 1 hour. If you need to specify multiple times for different days you can use” /time:” option many times. If you give “*” instead of PASSWORD, a password prompt will be shown so as not to reveal the password.
Links
Article on MS Knowledge Base | Shutdown your computer using command prompt
Comments
comments

Yes! Finally someone writes about blogger code.
Heya i am for the first time here. I came across this board and I find It really useful & it helped me out a
lot. I hope to give something back and aid others like you aided me.
I actually wish to book mark this specific blog post, “Free parental control, built in time restrictions in Windows XPSimple Informations”
on my very own web-site. Will you care in the event that Ido?
Thank you -Barney
We are a group of volunteers and starting a new scheme in our community. Your web site provided us with useful info to paintings on. You have performed an impressive task and our whole neighborhood will be grateful to you.
It is pretty good, but it did not log off or shut down the computer when the user keep using the computer over the limited time given.
I use Qustodio from http://www.qustodio.com. Its free and a complete parental control solution. Pretty straightforward install, no user intervention, blocks sites in real time, and also tracks data. It also monitors activities that kids indulge in on social media platforms. Anyone looking for parental control must try it.
God Bless… How did I never knew…
6am-8am only on fri-sun*
If I wanted the user to play from 6am-8am (2 hours) how would I format that?
Sure why not.. Please use the contact form and send me your mail id. I will get back to you..
I’m struggling with this. To show you what I mean I really want to send you a screen shot of the cmd box – is this possible?
Hi Jeff,
sorry for the late reply. When I tried
8:00-12:00 (use 24 hour format)
it worked. Please try this and lemme know
hello im trying to do what you are saying above
but every time i try the system says:
“invalid range specified days”
what do i do wrong ?
im using windows xp home edition
code line:
net user USERNAME /time:M-F,8am-8pm
Gonna bookmark this, appreciate it man
Ron,can you give a link to a page explaining how that is done? I can’t find a good source to read..
Ajith,
The Vista parental control can be bypassed via CMD control. How can this be avoided?
Thanks,
- Ron
Ajith,
I have a question in Window Vista –
The Vista parental control can be bypassed. How can this be avoided?
Thanks,
- Ron
gostaria de ter em meu pc o programa da família
How pathetic the Windows operating system is. Using a command prompt to set parental controls – boy that’s intuitive, easy and convenient – not. This should be an easy to use control panel like on the Mac, not a buried command prompt that nobody can find or use.
This is a very interesting article. I am also looking for ways to setup an eee pc (XP) for my son. We mostly use Macs and would love to have similar functions that parental control on Mac has. So with time limits, I would love to hear how the PC can automatically log off the user when the time is up. Can’t wait for the development in this thread!
Thanks for this information.
Hi erick..
When I was on blogger last year I had done a post on scheduled tasks as well as on shutdowns.. but I was not able to repost it here. I will soon repost it…
Thank you very much for your interest..
Hi, if the user stays logged in past the time set they are not logged out. However, I have a scheduled task for my computer to hibernate at a certain time each day. Check http://www.wcgwiki.org/en/general/hibernate.cfm . For scheduled shutdown instead check http://www.coderetard.com/2008/06/18/automatic-windows-shutdown-with-scheduled-tasks/ . No installs, just simple instructions to make Windows do what you want. I have not looked into making it user specific so it does it for all users on the computer. However, this site controls log ins and the others control logging out.
K9webprotection is a hundred times better than the default XP one. But it can only control internet access
I’m very interested in this question as well. For me, it’s useless unless it will log them off when the time is up. Or, is there any shareware out there that does the same thing?
Hi Khew.. I am gonna try that and then tell you the result..
Hi,
There was a question about what happens if they are logged on during the allowed hours, but they stay logged on past the ending hour? Will the pc log them off or shut down? what happens?
Any observations on that?
Thanks!
Thanks Brit… forgot it somehow.. will reply soon
Anything new with this?
Add the user to a non administrative group..
What happens if the user figures out they just change the system time to fit into the allowed time schedule?
I suppose XP home can’t do user level rights to prevent them changing the system time…
Is this better than the free-for-home-use k9webprotection solutions?
Excelent comments. My Favorit Blog. Thank you Autoversicherung
OK I think you can do it with task scheduling.. So I will reply by this Sunday..
Ajith I will be very happy with the easier option! i.e a continuous slot of 30 minutes starting at a particular time on weekdays (and, if possible, a 45 minute slot at a different starting time on saturdays and sundays.)
Alok it is much easier to allow your an account to use net continuously for 30 or 40 minutes. It is very hard to set an account to have internet access for a total of 40 minutes in different slots. I will post about how to do the former.. this week
Hi Ajith,
Thanks for the prompt response !
I am using BSNL’s broadband connection.
Hi Alok..
We can implement this in a different way actually. Please tell me which mode of Internet access you use – using dialup or LAN
Hi Mike,
thanks for your comment…
I am currently testing the condition you specified.. please wait for a day.. I will reply soon
I want my kid to use the Internet for not more than 30 to 40 minutes a day.
Can this command, in some modified form, be used to only restrict the time Internet is used instead of restricting the long-on time of the whole computer. I have windows xp home on my pc.
What happens if they are logged on during the allowed hours, but they stay logged on past the ending hour? Will the pc log them off or shut down? what happens?
Hi Reidsi,
Answers :
1, Yes, you can reset the user password using the method mentioned here – http://www.exnol.com/windows/globally-control-and-change-all-users-passwords-in-windows ,
2, If you have changed the users allowed time and after that the user changes their password, it would not affect the control. The time control will still be enabled.
I think that would have cleared your doubts. If you have any more doubts please feel free to contact me or comment me.Thank you for you interest
Sound great however:
1, What happens if you don’t know the password of the user A/C your trying to control. Can you still control the A/C without it?
2, What happens if you initially know the password, however, the user your trying to control changes their password? Can they now get in?
Thanks Saman BTW hows your studies going..You are really into studies now right..
This is a great How-To and one that I bet a lot of people have wondered about!