Jump to content

Autologon doesn't seem to work


Recommended Posts


Why are you putting >nul????

you dont need to

Can someone explain what I should do then to fix my problem of it not creating an account for me
cmdlines.txt

[COMMANDS]

"USERS.CMD" (is the .\USERS.CMD different???)

users.cmd

@Echo Off

reg export "hklm\software\microsoft\windows nt\currentversion" anyfilename1>nul

find /n "RegisteredOwner" anyfilename1>anyfilename2

FOR /F "tokens=2 delims==" %%i in (anyfilename2) do set FName=%%i

set FName=%FName:~1,-1%

net user "%FName%" /add>nul

net localgroup administrators "%FName%" /add>nul

del anyfilename1

del anyfilename2

Thanks

]Bonkers[

Link to comment
Share on other sites

quya: I couldn't get the longer code to work

@Echo Off

reg export "hklm\software\microsoft\windows nt\currentversion" anyfilename1>nul

find /n "RegisteredOwner" anyfilename1>anyfilename2

FOR /F "tokens=2 delims==" %%i in (anyfilename2) do set FName=%%i

set FName=%FName:~1,-1%

net user "%FName%" /add>nul

net localgroup administrators "%FName%" /add>nul

del anyfilename1

del anyfilename2

so I used
@ECHO OFF

net user "UserName" /add>nul

net localgroup administrators "UserName" /add>nul

and that worked.

Thanks

]Bonkers[

Link to comment
Share on other sites

Hi, Bonkers

I check it immediately by run userd.cmd in Dos command prompt, it seems perfect. So what's wrong with you? Can you tell me the error message? Thanks!

By the way, is there any other one can try and tell me the result?

Link to comment
Share on other sites

Hey Quya....thanks for your help on this topic....

I've tried this (using the cmdlines.txt and installs.cmd) ....and I"m not quite getting the result I'm looking for...

My username is being created, however it is auto-logging me in as "Administrator"....and I would like to fix that :D

My Winnt.sif file:

;SetupMgrTag
[Data]
   AutoPartition=0
   MsDosInitiated="0"
   UnattendedInstall="Yes"

[Unattended]
   UnattendMode=FullUnattended
   OemSkipEula=Yes
   OemPreinstall=Yes
   TargetPath=\WINDOWS
   Repartition=No
   UnattendSwitch="Yes"
   WaitForReboot=No
   AutoActivate=No
   DriverSigningPolicy=Ignore

[GuiUnattended]
   AdminPassword=(edited for this quote)
   EncryptedAdminPassword=NO
   AutoLogon=Yes
   OEMSkipRegional=1
   TimeZone=4
   OemSkipWelcome=1

[UserData]
   ProductKey=(edited for this quote)
   FullName="Cam"
   OrgName=""
   ComputerName=EnterNameHere

My cmdlines.txt file:

[COMMANDS]
".\INSTALLS.CMD"

And my installs.cmd file:

@ECHO OFF
net user "Cam" /add>nul
net localgroup administrators "Cam" /add>nul

Not sure what I'm doing wrong (not really sure what I'm doing in general, but hey I'm trying :) ).

Any help would be really appreciated....Thanks :rolleyes:

Link to comment
Share on other sites

this is the code i use

CLS
TITLE Creating User Accounts
ECHO.
ECHO Please wait while Windows sets up your user accounts
ECHO.
ECHO Setting up 1st account
net user name password /add  /FULLNAME:" my name" /EXPIRES:never /PASSWORDREQ:yes
net localgroup "Power Users" name /ADD
net localgroup "users" name /DELETE
ECHO.
ECHO Setting up 2nd account
net user anothername anotherpassword /add  /FULLNAME:" my other name" /EXPIRES:01/01/2004 /PASSWORDREQ:yes
net localgroup "Users" anothername /ADD
ECHO.
net user >> "C:\user.log"
net user name >> "C:\user.log"
net user anothername >> "C:\user.log"
EXIT

and it is all good, works perfectly

Lee.......

Link to comment
Share on other sites

where does the password go into?

Not quite sure what you mean, but i have an inclining you might mean you want an example

ie: net user AarronXP "password" /add <--! replace password with your desired password WITHOUT the quotes -->

if you are on about net user "name" >> "C:\user.log" , then this is the result

C:\>net user lee

User name lee

Full Name

Comment

User's comment

Country code 000 (System Default)

Account active Yes

Account expires Never

Password last set 8/15/2003 3:00 PM

Password expires 9/27/2003 1:47 PM

Password changeable 8/15/2003 3:00 PM

Password required Yes

User may change password Yes

Workstations allowed All

Logon script

User profile

Home directory

Last logon Never

Logon hours allowed All

Local Group Memberships *Power Users

Global Group memberships *None

The command completed successfully.

hope this all helps

Link to comment
Share on other sites

if you would like to delete a user then put this in your command script

CLS

@ECHO OFF

ECHO.

ECHO Removing ASP.NET User Account created by .NET Framework 1.1...

net user aspnet /delete

ECHO.

this is easier that using deluser.exe, no need to copy anything over, and uses the same amount of code, infact uses less code

Hope this helps

Lee...

Link to comment
Share on other sites

Thanks Lee...I'll substitute your code for mine and give it a go... :)

Maybe I'll check this is ok before I go burning another cd....how does this look for my installs.cmd? (Username is "Cam", password is "123456")

@ECHO OFF
CLS
TITLE Creating User Accounts
ECHO.
ECHO Please wait while Windows sets up your user accounts
ECHO.
ECHO Setting up User account
net user "Cam" 123456 /add  /FULLNAME:"Cam" /EXPIRES:never /PASSWORDREQ:yes
net localgroup "Power Users" name /ADD
net localgroup "users" name /DELETE
ECHO.
ECHO.
ECHO Removing ASP.NET User Account created by .NET Framework 1.1...
net user aspnet /delete
ECHO.
net user >> "C:\user.log"
net user name >> "C:\user.log"
net user anothername >> "C:\user.log"
EXIT

Link to comment
Share on other sites

Thanks for explaining, looks all clear to me now! Has anyone been able to prevent setup from logging into the default admin account, and force Setup to login with your own created username to run the batch in?

I was thinking about running the autologin registry tweak from cmdlines, or deleting the default admin account via net commands but I'm not so sure about that.

Link to comment
Share on other sites

you dont need quotes around your username

another tip i use is to make a new cmd script with the code i want and test it ie:

make a username and password up and run the script

check to see if the code works, if it does then put it in your main script, that way no wasted discs

you can allways delete the user from the example i posted earlier

i do that to all my scripts to test them including software

Link to comment
Share on other sites

AarronXP: net user Administrator /delete will not work

xp will not allow you to delete admin account

there is a way but it might take me a little while to sort the code out, basically what it will do is log in as admin for a split second add users write a registry value and log off then log on as the new user and start the setup process... it seems feasible just gotta try a few things out first though, will post the code and everything a.s.a.p

Lee....

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