Question

I am a college student taking an INTRODUCTORY Windows 10 operating system SCRIPTING course and need...

I am a college student taking an INTRODUCTORY Windows 10 operating system SCRIPTING course and need some help with creating this batch script.  

I need to create the below menu:

Please choose a task from the list below

A) Add a new user account

I need to use the SET /P command to add a new user and prompt for a login name. Check if the user already exists and if so display an appropriate message and return to the menu.

If the user doesn't already exist, prompt for the user's password and full name and add the user. If the user account is added, display a message (one that includes the user's login name) that indicates the user was successfully added.

Thanks.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

To add a new user account on the local computer:

net user username password /ADD

Example: To add a new user account with the loginid John and with password fadf24as

net user Andola blabla123/ADD

Hide password

If you do not want the password to be visible while adding new user account, you can use ‘*’ as shown below.

C:\>net user /add John *
Type a password for the user: 
Retype the password to confirm:
The command completed successfully.
C:\>

To add a new user account to the domain:

net user username password /ADD /DOMAIN

Note that the command does not include the domain name.

Example:

net user Andola blabla123 /ADD /DOMAIN

Rename a user account

Net use command does not have any switches to rename a user account. But we can do that using wmic commands. Please check this – Rename user accounts on Windows

Few more Advanced uses of net user command.

To set user full name while creating the user account

net user username password /ADD /FULLNAME:"User_Fullname"

To allow user to change password:

net user username password /ADD /PASSWORDCHG:Yes

To restrict user not to change the password:

net user username userpasswd /ADD /PASSWORDCHG:NO

To set account expiry time we can use /EXPIRES switch. This can also be used to set that the account never expires.

To specify if the user must have a password set we can use /PASSWORDREQ switch. For more information on all net user options, read this – Net user command: syntax and examples

How to create a new administrator account?

An administrator account can’t be created directly. We first need to create a user account and then add the user to the administrators group.

Errors:

  1. If you don’t have privileges to add new user account to the system, you would get an error like below.
    C:\>net user John /add
    System error 5 has occurred.
    Access is denied.
    C:\>
  2. While adding user to domain, make sure that your computer is connected to the domain. Otherwise it throws up below error.
    C:\>net user testuser testpassword /ADD /DOMAIN
    The request will be processed at a domain controller for domain mydomain.com.
    System error 1355 has occurred.
    The specified domain either does not exist or could not be contacted.
Add a comment
Know the answer?
Add Answer to:
I am a college student taking an INTRODUCTORY Windows 10 operating system SCRIPTING course and need...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need...

    I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need some help with the batch file I am creating for a homework assisgnment.   I created the menu below and need some help with option A Please choose a task from the list below A) Add a new user account I need to use SET /P to prompt for a login name and if the user already exists display a message and return to the...

  • I am a college student and need some help with this homework problem. I am taking...

    I am a college student and need some help with this homework problem. I am taking an introductory Operating Scripting course (windows 10) I need to create a batch file named UserInfolog.bat.   Instead of displaying the output to the screen, redirect all output to a file named computername.log and it must be created each time the batch file is executed.   After redirecting the output to the log file, the batch file must display that file's contents in the command prompt...

  • I am taking an INTRODUCTORY Windows OS scripting course and could use your help in completing...

    I am taking an INTRODUCTORY Windows OS scripting course and could use your help in completing this homework assignment: I need to make sure that my batchfile directory is automatically included in the search path every time I open a command prompt window. My answer must be a step-by-step explanation (bulleted or numbered list) of the EXACT approach I took to complete this task. I must also provide an explanation of EXACTLY how I tested this to make sure it...

  • Windows operating system 1. Write a simple batch file named LastName Final.bat (where LastName is your...

    Windows operating system 1. Write a simple batch file named LastName Final.bat (where LastName is your own last name), which accomplishes the following: a Disable echo output b. Clear the screen c. Welcome the user with the following message (where current Date and curent Time is the computer's current date and current time, respectfully-these values should be output using a command line command, meaning do not type in the date or time into your batch file). A sample of this...

  • Problem 1 Write a BASH script to create a user account from the Linux system on...

    Problem 1 Write a BASH script to create a user account from the Linux system on which your script is run. The script should process two positional parameters. First positional parameter is supposed to be a string with a user name (e.g., user_name) Second positional parameter is supposed to be a string with a user password (e.g., user_password) In your script: Check if two positional parameters were passed to your script when it was invoked If NOT, print an appropriate...

  • I have to use java programs using netbeans. this course is introduction to java programming so...

    I have to use java programs using netbeans. this course is introduction to java programming so i have to write it in a simple way using till chapter 6 (arrays) you can use (loops , methods , arrays) You will implement a menu-based system for Hangman Game. Hangman is a popular game that allows one player to choose a word and another player to guess it one letter at a time. Implement your system to perform the following tasks: Design...

  • need help in Java Now we’ll continue our project by writing a Facebook class that contains an ArrayList of Facebook user...

    need help in Java Now we’ll continue our project by writing a Facebook class that contains an ArrayList of Facebook user objects. The Facebook class should have methods to list all of the users (i.e. print out their usernames), add a user,delete a user, and get the password hint for a user You will also need to create a driver program. The driver should create an instance of the Facebook class and display a menu containing five options: list users...

  • Hello I am taking an Introduction to Programming class and I need help coming up with...

    Hello I am taking an Introduction to Programming class and I need help coming up with a Psuedocode for an algorithm. Here is the assignment: 1. Use an array to prompt the user to enter a credit card account number 2. Use the sequential search algorithm to locate the credit card number entered by the user 3. If the credit card number is NOT in the array, display a message indicating the number is invalid 4. If the credit card...

  • Hello all, I have a c++/unix (bash) question. I am struggling on starting this assignment. If...

    Hello all, I have a c++/unix (bash) question. I am struggling on starting this assignment. If you could start the assignment and tell me how to do the rest it would be greatly appreciated! (Quick thumbs up answer response if thorough and correct) Maintain automobile records in a database Write a shell script to create, view and modify a simple database that contains automobile records. The shell script has to be done in Bourne shell syntax (bash as a matter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT