Jump to content

Make WindowsXP ask you to create an account next time you start Window


Recommended Posts

Posted

Hey there

Say, I am logged in with the Admin account.

For the next start, I would like to make XP to ask the user to create a new account.

How can this be done?

Its something like making an unattended installation, that installs a bunch of software, and then the last thing to do, is asking the user to create an account.

The different is, that I am making the complete installation, then I just want to leave it to another user who will start the computer and just create an account for himself and see the computer fresh and new installed.

Any idea?

/H.


Posted

Sounds easy enough to do. A simple batch file would work if you're not looking for anything fancy.

Just prompt them for an ID and password, pipe those into a "Net User" command (http://unattended.msfn.org/intermediate/users.htm#net) and then reboot. If your automated CD is already logged in using the local admin account you shouldn't have any problems.

You can get fancy and use VB scripts and/or HTAs to make a nice looking dialog box.

Posted

Here is a simple batch file that will do the trick.

set /p name=[Please Enter ID:]
echo %name%
set /p pw=[Please Type a Password:]
echo %pw%
echo.
echo %name%
echo %pw%

net user %name% %pw% /add

You can jazz it up all you want. Here is how it works:

set /p name=[Please Enter ID:]

This will put up a message [Please Enter ID:] and wait for the user to type in an ID. It will then assign this to the "name" variable. I then echo it just for fun. You can add in a message or something like, "You have chosen %name% as your ID." for the user.

The same logic is used to get a password for the user. Again, I echo it just so that you can see it working.

net user %name% %pw% /add

This creates a local user account using the name and password that the user keyed in. You can add them to groups if you wish (the link to the Unattended guide in my above post shows how).

That's it. I would add in an immediate reboot of the box after creating the account so that the user can't play around while the system is logged in as an admin. Change the prompts, set the screen/text colors, etc.

Mike

Posted

Hey there

So the last tip you wrote; can it help me, if I want him to write his name and stuff? I dont know the data in advance.

You know, just like when you're installing windows from the beginning.

I gotta test around what I got so far, while I am waiting for more info here from you.

Posted

This sounds really hard to do!

What about: find the EXE that runs the new user

account applet/wizard/window and make a CMD

file to run that and then delete the CMD file - can

a CMD file delete itself?! I guess so :S

The CMD file (on what sounds like a "semi-unattended" setup) would be here:

$OEM$\$Docs\All Users\Start Menu\Programs\Startup

Then to delete itself after install...

DEL "%ALLUSERSPROFILE%\STAR~1\Programs\Startup\newuser.cmd"

Although the fact that the system reboots after installing windows

means to me, how can you get it so you turn the PC on and there is

the new user account screen?! What about some kinda bootable CD?

Posted (edited)

The code I have in my post above is a batch file that does the job very simply.

Put it at the end of your automated install. When run it will open a command window and prompt the user to key in a user ID (you can change the message to what ever you like). The user keys in an ID and hits ENTER. They're then prompted to key in a password. They type in a password and hit ENTER. The batch file then creates that account and gives it that password.

The echos are for show. You can take them out and do the entire process with just three lines.

Copy this into a batch file (for example "Newuser.bat")

set /p name=[Please Type an ID:]
set /p pw=[Please Type a Password:]
net user %name% %pw% /add

It's that simple.

Now, you can add to it all you want. For example, echo a message that explains what you want them to do. ("You will now need to choose and ID and password to use this computer........"). You can have it echo back thier selections ("You've choosen to use jdoe as your ID and drowssap as your password......").

You can really get creative if you want. It's a simple batch file.

Take this for an example:

@echo off
REM ============================================

ECHO You will now be asked to create an ID and password to use on this
ECHO computer. Please remember your password and do not give it to
ECHO anyone else.
ECHO.
ECHO You will first be asked to choose an ID. At the prompt type in the
ECHO ID that you want to have and press the ENTER key. You will then be
ECHO prompted to choose a password. Type that in and press the ENTER key.
ECHO After you have done that the account will be created and the system
ECHO will be rebooted. You can then log in using the ID and password you
ECHO picked.

PAUSE

CLS

set /p name=[Please Type an ID:]
set /p pw=[Please Type a Password:]
ECHO.
ECHO You have chosen to use "%name%" as your ID and "%pw%" as your password.
PAUSE

ECHO.
ECHO I've commented out the line that creates the account.
REM net user %name% %pw% /add

ECHO.
ECHO I've commented out the following line that would restart the computer.
REM SHUTDOWN -r -t 5

PAUSE
EXIT

Mike

Edited by mmarable
Posted

Thanx Marble

So the only solution is BAT based? I thought there would be some kind of standard windows application, jus tlike the one that starts when you installa a new copy of XP and that ask you to create an accound, and who will be using the computer.

Maybe something with sysprep?

If so, what parameter should I use.

Posted

marble,

I did make some tests with sysprep

I was using the sysprep tool, and it did 90% what I wantet to do.

It made the computer start just like when you buy a new computer, or when you installed a windows from scratch.

What was missing was the list where you can add a bunch of users - is it possible to make that window to appear, instead of using the batch method?

Regarding to sysprep, what is the parameter to make sysprep.exe to use the answer file settings (sysprep.inf I think, it is called)

Is it possible, to make the sysprep restart to ask me/someone about what users are going to use the computer?

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...