HOW TO ADD LOCAL USER THROUGH
BATCH FILE WITH TIME RESTRICTION IN
WINDOWS
Suppose your computer is set up in an environment where most people
have access to it. Now, if you are thinking of using parental controls to
help establish the limits, you could be correct at times. Still, parental
controls work fine only with a Microsoft account. While creating user
accounts, you can customize them with permissions; you can set time
limits on any local accounts on your computer. For this, you just have to
make use of the Control Panel window and the interface will guide you
with creating a new user.
Sometimes you may feel to add new users through the command prompt
instead of using the computer's user interface. You have one other
option where you can create a batch file with the command to create a
new user. Once you run the batch file, the user will be created.
ADDING A LOCAL USER THROUGHBATCH FILE:
Open a Notepad file on your computer. Type the command net user
(type your user name) (Password) /add; for example, if you want to
create a user name user1, the command should look like net user user1
pwd /add. Now click File followed by Save as and type the file name as
“user.bat” including the quotes. Hit the Save button by selecting the file
destination. Now, double-click the batch file you just created and this will
open the command prompt window. Also, this will create the user named
user1 with password pwd.
CREATINGUSER WITH TIME RESTRICTION:
Earlier, we saw how to add a user to your computer using a batch file.
Windows provides options using which you can restrict the access time
for any particular user. The time restriction can be added while creating
the user itself. But, if you have already created a user, can you set the
time restrictions? Yes, you can. All you need to do is type a line of code in
the command prompt. In case you want to do this as well using a batch
file, then it is similar to creating a user using a batch file.
Open a text file and type the command net user <username>
/time:<day>,<time> in it. You need to modify this syntax to your
requirements.
ENTERINGTHE REQUIREDDETAILS INSIDE THE TAGS <>:
Type the user name in <username>. Replace the tag <day> with the day
you want to set limits on. You can write the names of the days or use
short names or initials such as the following: Su, M, T, W, Th, F, Sa.
Replace <time> with a 12-hour format or 24-hour format. You have the
limitation of using one-hour increments only, so don’t add any minutes to
the time format as it won't accept. You can restrict a user account to
some time duration, let's say from 9:00 am to 6:00 pm on Sunday. You
can specify the range of days using the following command: net user
user1 /time: M-Th, 9 am-6 pm. If you are using the command but still
leave the blank space in time, this will lead to a temporary lockout to your
account.
The above-discussed procedure can be used to add a local user through a
batch file with time restrictions in Windows.

How to add local user through batch file with time restriction in windows

  • 1.
    HOW TO ADDLOCAL USER THROUGH BATCH FILE WITH TIME RESTRICTION IN WINDOWS Suppose your computer is set up in an environment where most people have access to it. Now, if you are thinking of using parental controls to help establish the limits, you could be correct at times. Still, parental controls work fine only with a Microsoft account. While creating user accounts, you can customize them with permissions; you can set time limits on any local accounts on your computer. For this, you just have to make use of the Control Panel window and the interface will guide you with creating a new user. Sometimes you may feel to add new users through the command prompt instead of using the computer's user interface. You have one other option where you can create a batch file with the command to create a new user. Once you run the batch file, the user will be created. ADDING A LOCAL USER THROUGHBATCH FILE: Open a Notepad file on your computer. Type the command net user (type your user name) (Password) /add; for example, if you want to create a user name user1, the command should look like net user user1 pwd /add. Now click File followed by Save as and type the file name as “user.bat” including the quotes. Hit the Save button by selecting the file destination. Now, double-click the batch file you just created and this will open the command prompt window. Also, this will create the user named user1 with password pwd. CREATINGUSER WITH TIME RESTRICTION: Earlier, we saw how to add a user to your computer using a batch file. Windows provides options using which you can restrict the access time
  • 2.
    for any particularuser. The time restriction can be added while creating the user itself. But, if you have already created a user, can you set the time restrictions? Yes, you can. All you need to do is type a line of code in the command prompt. In case you want to do this as well using a batch file, then it is similar to creating a user using a batch file. Open a text file and type the command net user <username> /time:<day>,<time> in it. You need to modify this syntax to your requirements. ENTERINGTHE REQUIREDDETAILS INSIDE THE TAGS <>: Type the user name in <username>. Replace the tag <day> with the day you want to set limits on. You can write the names of the days or use short names or initials such as the following: Su, M, T, W, Th, F, Sa. Replace <time> with a 12-hour format or 24-hour format. You have the limitation of using one-hour increments only, so don’t add any minutes to the time format as it won't accept. You can restrict a user account to some time duration, let's say from 9:00 am to 6:00 pm on Sunday. You can specify the range of days using the following command: net user user1 /time: M-Th, 9 am-6 pm. If you are using the command but still leave the blank space in time, this will lead to a temporary lockout to your account. The above-discussed procedure can be used to add a local user through a batch file with time restrictions in Windows.