Jump to content

Adding user accounts, Getting this Error Msg


Recommended Posts

Welcome... :) Now I have a question to you guys.

this is the code to user.cmd

@ECHO OFF

REM ----------------------------------------------------------------------
ECHO Setting Up User Accounts
ECHO.

ECHO Creating a default user account with no password set
net user "Sky" /add
net localgroup "Administrators" "Sky" /add

PAUSE
Press any keys to continue...

EXIT

It created the Sky User Profile after the installation. But I still get this error message. Can someone tell me why I'm getting this and how to correct it? I think I'm getting the syntax mess up or something.

The user or group acount specified cannot be found.

The user was successfully created but could not be added to the USERS local group.

Link to comment
Share on other sites


Frustrating, isn't it? I would say from the looks of things, you have us all stumped. The syntax looks fine to me. I can only offer you some hints for further debugging:

Seperate the commands, perhaps with a pause in between, to determine which of the two is guilty.

I have it working on my system with this code:

NET USER SysAdmin SysAdmin /ADD /COMMENT:"System Administrator Account" /PASSWORDREQ:YES
NET USER User User /ADD /COMMENT:"Local User Account" /PASSWORDREQ:YES
NET LOCALGROUP Administrators SysAdmin /ADD
NET USER Administrator /ACTIVE:NO

Replace yours with this, and see if that works (Perhaps Sky and Windows do not jive - anything is possible at this point). (Pay attention, my code disactivates the administrator account, and creates the users SysAdmin and User, both with passwords. But DON'T modify my code, as it works, and in doing so you are adding one more unknown to the debugging. After you get it working as I have it, makes changes one at a time, until you find the error.)

Open a command prompt in the setup, just before the NET commands:

START CMD

Try your commands, either by stepping through the batch file from one pause to the next, and see if anything is happening in the Users List - You can get to the Local Users and Groups Snap-In as such:

From the command prompt, type "mmc" (without the quote - same applies for following examples)
This will open a Microsoft Management Console.
Select File - Add/Remove Snap In.
Click "Add" in the new window.
Select "Local users and Groups", then click "Add".
Select "Local Computer" and click "Finish".
Click"Close".
Click "OK".

You should now have the familiar Local users and Group Snap-In running in the console.

While you have the command prompt, try anything else you can think of...

Now you've got me curious. Give some or all of that a try, and let us know what you discover.

Link to comment
Share on other sites

Yes I have the a pause in between those two NET commands in my user.cmd when testing my unattended files. Creating the user account is fine but adding to the user as an adminstrator isn't. I'll try your method tonight after work. I'll let you know what the result.

By the way, what is the difference between a domain and user group?

-Kenneth

Link to comment
Share on other sites

@ECHO OFF

REM ----------------------------------------------------------------------

ECHO Setting Up User Accounts

ECHO.

ECHO Creating a default user account with no password set

net user "Sky" /add

net localgroup "Administrators" "Sky" /add

PAUSE

Press any keys to continue...

EXIT

well i tried this and it worked, i cant tell you what the problem is, when are you trying to run it? have you applied any registry settings first? have you turned off any services or disabled anything else.

Link to comment
Share on other sites

devil270975, yes I do have the registry tweaks applied and then create a new user account after that in the text mode setup using the cmdline.txt. However, I only have one tweak which is to recover the phrase "shortcut to" when creating a shortcut as a test for this unattended installation. There is no other tweaks included. Therefore, I don't think the tweaks have anything to do with the problem that I'm having.

Futher, I only apply registry tweaks and create new user account in the text mode setup. After, I use the gui setup mode to install the applications and then do the cleanup and futrther customization of Windows.

-Kenneth

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...