Jump to content

Auto create User account in unattended install


Recommended Posts

I just started learning about slipstreaming XP installation and have successfully created a CD to install XP, Drivers, Reg Tweaks, and my apps (Nero, Winrar, Acrobat Reader 6, and NaV). Two problems still plague me.

1. After installation of Winrar I need my rarreg.key file copied to my Winrar folder on the hard drive. This is the command I use...

ECHO Installing WinRAR 3.20

ECHO Please wait...

start /wait %systemdrive%\install\Applications\WinRAR\wrar320.exe /s

ECHO.

ECHO Copying WinRar Registration Key...

COPY "%systemdrive%\Install\rarreg.key" "%systemroot%\Program files\Winrar"

The rarreg.key is in the $OEM$\$1\Install folder. The error message is "Cannot find path specified". I thought %systemroot% variable is C:\

2. I tried to follow the instructions provided by WebMedic for creating a User account but it didn't work. Probably because I don't understand what files are needed and where they should go. A more detailed explanation would be greatly appreciated.

Thanks!

Link to comment
Share on other sites


%systemdrive% = Root of where you installed Windows. Ie. C:\

%systemroot% = the windows directory. Ie C:\WINDOWS\

You need to use this line:

COPY "%systemdrive%\Install\rarreg.key" "%systemdrive%\Program files\Winrar"

Link to comment
Share on other sites

Thanks to b0r3d and webmedic for their quick help. Within 10 minutes of my post my questions are answered. I've got my slipstreamed XP cd burned and am currently installing XP. I really appreciate your help.

Link to comment
Share on other sites

use a .vbs script and call that in your guirunonce;

script looks like this:

Option Explicit
' On Error Resume Next

Dim objComputer, objGroup, objUser, objWSHNetwork, strComputerName, strFullName, strPassword, strUserName

Set objWSHNetwork = WScript.CreateObject("WScript.Network")
strComputerName = objWSHNetwork.ComputerName
Set objComputer = GetObject("WinNT://" & strComputerName)
Set objGroup = GetObject("WinNT://" & strComputerName & "/Administrators")

strUserName = "username"
strFullName = "full name"
strPassword = "password"

Set objUser = objComputer.Create("User", strUserName)
objUser.SetPassword strPassword
objUser.FullName = strFullName
objUser.SetInfo
objGroup.Add "WinNT://" & strComputerName & "/" & strUserName
objUser.SetInfo

Those " " have to stay..but i guess you figured that out allready :)

Link to comment
Share on other sites

to late in the process. The way I described loads the user settings much earler so that everything is setup correctly.

guirunonce doesn't run till after the first login which will happen as admin and then the progies wont be installed as your user.

Link to comment
Share on other sites

Hmmm, must be doing something wrong. The installation went well but upon booting I get an error message stating "The system could not log you on. Make sure your user name and domain are correct". Under Control Panel | Users the User account is not there. I created the account manually and the system boots fine. I've listed my four files and seperated them with a line. (the seperating line is not in my file)

I would appreciate if someone could look these over and spot my mistake. Here are my files...

Winnt.sif located in the i386 folder:

;SetupMgrTag

[Data]

AutoPartition=0

MsDosInitiated="0"

UnattendedInstall="Yes"

[unattended]

UnattendMode=FullUnattended

OemSkipEula=Yes

OemPreinstall=Yes

TargetPath=\WINDOWS

Repartition=No

UnattendSwitch="Yes"

WaitForReboot="No"

DriverSigningPolicy=Ignore

OemPnPDriversPath="Drivers\Audio;Drivers\Video"

[GuiUnattended]

AdminPassword="*"

EncryptedAdminPassword=NO

OEMSkipRegional=1

TimeZone=20

OemSkipWelcome=1

[userData]

ProductID=***** (key not listed)

FullName="User"

OrgName="None"

ComputerName="Computer"

[Display]

BitsPerPel=16

Xresolution=1024

YResolution=768

Vrefresh=70

[RegionalSettings]

LanguageGroup=1

[identification]

JoinWorkgroup=WORKGROUP

[Networking]

InstallDefaultComponents=Yes

[GuiRunOnce]

%systemdrive%\install\applications.cmd

______________________________________________

cmdlines.txt located in the $oem$ folder:

".\user.cmd"

______________________________________________

User.cmd located in the $oem$ folder:

CLS

@ECHO OFF

ECHO Adding Default User...

net user User /add

net localgroup "administrators" User /add

ECHO.

ECHO Applying Root Registry Tweaks...

REGEDIT /S %systemdrive%\install\Reg_Root_Tweaks.reg

ECHO.

EXIT

______________________________________________

Windows Registry Editor Version 5.00

;This will allow you to autologin.

;Replace InsertName value with the Username you want to autologin with.

;Replace InsertPassword value with the password corresponding to the Username specified.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

"DefaultUserName"="User"

"DefaultPassword"=""

"AutoAdminLogon"="1"

(There is no space between the quotes in DefaultPassword)

I don't know if it helps but this is the Applications.cmd file I use:

CLS

@echo off

ECHO.

ECHO Applying Registry Tweaks...

REGEDIT /S %systemdrive%\install\RegTweaks.reg

ECHO.

ECHO Installing Symantec Antivirus Corporate 8.1

ECHO Please wait...

start /wait %systemdrive%\install\Applications\NAV\savceclt.exe /qn

ECHO.

ECHO Installing WinRAR 3.20

ECHO Please wait...

start /wait %systemdrive%\install\Applications\WinRAR\wrar320.exe /s

ECHO.

ECHO Copying WinRar Registration Key...

COPY "%systemdrive%\Install\rarreg.key" "%systemdrive%\Program files\Winrar"

ECHO.

ECHO Installing Adobe Reader 6

ECHO Please wait...

start /wait %systemdrive%\install\Applications\AdobeReader6\AR6.msi /QB

ECHO.

ECHO Installing Microsoft JavaVM - Build 3809

ECHO Please wait...

start /wait %systemdrive%\install\JavaVM\MSJavx86_3809full.exe /Q:A /R:N

ECHO.

ECHO Updating Microsoft JavaVM to 3810

ECHO Please wait...

start /wait %systemdrive%\install\JavaVM\msjavwu_3810update.exe /Q:A /R:N

ECHO.

ECHO Installing Nero Burning ROM v6.0.0.11

ECHO Please wait...

start /wait %systemdrive%\install\Applications\Nero\Nero60011.exe /silent /noreboot

ECHO.

ECHO Registering Nero Burning ROM...

REGEDIT /S %systemdrive%\install\Applications\Nero\register.reg

ECHO.

ECHO Installing Windows Media Player 9

ECHO Please wait...

start /wait %systemdrive%\install\WMP9\MPSetupXP.exe /Q:A /R:N

ECHO.

ECHO Installing DirectX 9.0b

ECHO Please wait...

start /wait %systemdrive%\install\DirectX9b\dxsetup.exe /opk

ECHO.

EXIT

Link to comment
Share on other sites

nope his problem is that the reg file goes under $OEM$\$1\install

The installer will not see it if you dont put it there.

Not to mention that this would work just as well for setting up multpile accounts. You simply define your accounts in user.cmd like the first one is with the acception that you may not want them all to have admin rights.

Then you will need some code to get the old style login like so.

;Disable Welcome Screen and uses Classic Logon

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

"LogonType"=dword:00000000

now the final thing is that no matter what you have to login with at least one user to install your apps through guirunonce. So you will still want to use the login stuff I posted. Now you can always disable the autologin after the first boot in with another reg hack like so.

;This will allow you to autologin.

;Replace InsertName value with the Username you want to autologin with.

;Replace InsertPassword value with the password corresponding to the Username specified.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

"DefaultUserName"="User"

"DefaultPassword"=""

"AutoAdminLogon"="0"

I think that is it anyway it is untested by me. There you all go. Happy campers all. :)

Link to comment
Share on other sites

My bad, i didn't list the location of the Reg_Root_Tweaks.reg file. It is in the Install folder along with all my other reg files and the application.cmd file. I still have to manually create the User account. I tried the help offered by Twisted Maniac but it didn't work (thanks for trying). I've got everything else working, even added Alcohol 120% and the modified Winntbbu.dll (jlo) file.

I don't see a typing error so it must be something in the way the files are located or the order of the commands in the files.

Hope someone can point me in the right direction... Glad CD-r's are cheap...

Link to comment
Share on other sites

not sure if this would block oyu up but this

[GuiUnattended]

AdminPassword="*"

should be

[GuiUnattended]

AdminPassword=*

I'm not sure why taht would keep you from loging in though.

let me know if this works for you

and yea no kiding i've been through about 50 cd-r's or more. I'm doing installs in virtual pc now to save myself from wasting to many more cd's

Link to comment
Share on other sites

Still no luck on the creation of the User account. I'm made all the changes suggested by others (thanks for all the help so far!). XP completes the installation and all the software works but I'm still logged in as Administrator. I can manually create the account and get into the system but I was hoping to get over this one last hurdle.

Please read my earlier posts in this thread and see if anyone can find my mistake.

TIA!

Link to comment
Share on other sites

net user User /add
net localgroup "administrators" User /add

as far as i know it should be:

net user User pass /add
net localgroup Administrators /ADD User

twisted you are wrong, tcsdoc, you are right

to set up a user account from the command line is

net user name /add

net localgroup administrators name /add

if you are only setting up 1 account it will auto login AS LONG as you dont set a password if you need to add more users create another cmd script to add them at a later time after you have logged in and you dont need this code in the registry to auto login, no matter how many people say you do, you dont, if you dont specify a password you dont need to, to add a password later use

net user name password

Windows Registry Editor Version 5.00

;This will allow you to autologin.!!!!!!!YOU DONT NEED THIS!!!!!!!!!!!!!!!!!!

;Replace InsertName value with the Username you want to autologin with.

;Replace InsertPassword value with the password corresponding to the Username specified.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

"DefaultUserName"="User"

"DefaultPassword"=""

"AutoAdminLogon"="1"

Link to comment
Share on other sites

I didn't mention paswords because he did not seem to hve any set in his scripts. Are you trying to tell me that if I dont use the reg hack that it will autologin as my user anyway and not the admin account to do the irst install stuff?

At any rate it does work like it is. I'm wondering if maybe some of his other settings differ from mine in his winnt.sif but I dont see how that could be it as all the important stuff is looking like mine.

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