devil270975 Posted August 12, 2003 Posted August 12, 2003 Why are you putting >nul????you dont need toLee...
OGreenOLeaf Posted August 13, 2003 Posted August 13, 2003 I thought he showed them on there in his orignal post.. guess ill take them off
fillalph Posted August 13, 2003 Posted August 13, 2003 Why are you putting >nul????you dont need toCan someone explain what I should do then to fix my problem of it not creating an account for mecmdlines.txt[COMMANDS]"USERS.CMD" (is the .\USERS.CMD different???)users.cmd@Echo Offreg export "hklm\software\microsoft\windows nt\currentversion" anyfilename1>nulfind /n "RegisteredOwner" anyfilename1>anyfilename2FOR /F "tokens=2 delims==" %%i in (anyfilename2) do set FName=%%iset FName=%FName:~1,-1%net user "%FName%" /add>nulnet localgroup administrators "%FName%" /add>nuldel anyfilename1del anyfilename2Thanks]Bonkers[
fillalph Posted August 13, 2003 Posted August 13, 2003 quya: I couldn't get the longer code to work @Echo Offreg export "hklm\software\microsoft\windows nt\currentversion" anyfilename1>nulfind /n "RegisteredOwner" anyfilename1>anyfilename2FOR /F "tokens=2 delims==" %%i in (anyfilename2) do set FName=%%iset FName=%FName:~1,-1%net user "%FName%" /add>nulnet localgroup administrators "%FName%" /add>nuldel anyfilename1del anyfilename2so I used@ECHO OFFnet user "UserName" /add>nulnet localgroup administrators "UserName" /add>nuland that worked.Thanks]Bonkers[
quya Posted August 13, 2003 Posted August 13, 2003 Hi, BonkersI 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?
bigred Posted August 17, 2003 Posted August 17, 2003 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 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=EnterNameHereMy cmdlines.txt file: [COMMANDS]".\INSTALLS.CMD"And my installs.cmd file:@ECHO OFFnet user "Cam" /add>nulnet localgroup administrators "Cam" /add>nulNot 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
devil270975 Posted August 17, 2003 Posted August 17, 2003 this is the code i useCLSTITLE Creating User AccountsECHO.ECHO Please wait while Windows sets up your user accountsECHO.ECHO Setting up 1st accountnet user name password /add /FULLNAME:" my name" /EXPIRES:never /PASSWORDREQ:yesnet localgroup "Power Users" name /ADDnet localgroup "users" name /DELETEECHO.ECHO Setting up 2nd accountnet user anothername anotherpassword /add /FULLNAME:" my other name" /EXPIRES:01/01/2004 /PASSWORDREQ:yesnet localgroup "Users" anothername /ADDECHO.net user >> "C:\user.log"net user name >> "C:\user.log"net user anothername >> "C:\user.log"EXITand it is all good, works perfectlyLee.......
devil270975 Posted August 17, 2003 Posted August 17, 2003 where does the password go into?Not quite sure what you mean, but i have an inclining you might mean you want an exampleie: 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 resultC:\>net user leeUser name leeFull Name Comment User's comment Country code 000 (System Default)Account active YesAccount expires NeverPassword last set 8/15/2003 3:00 PMPassword expires 9/27/2003 1:47 PMPassword changeable 8/15/2003 3:00 PMPassword required YesUser may change password YesWorkstations allowed AllLogon script User profile Home directory Last logon NeverLogon hours allowed AllLocal Group Memberships *Power Users Global Group memberships *None The command completed successfully.hope this all helps
devil270975 Posted August 17, 2003 Posted August 17, 2003 if you would like to delete a user then put this in your command scriptCLS@ECHO OFFECHO.ECHO Removing ASP.NET User Account created by .NET Framework 1.1...net user aspnet /deleteECHO.this is easier that using deluser.exe, no need to copy anything over, and uses the same amount of code, infact uses less codeHope this helpsLee...
bigred Posted August 17, 2003 Posted August 17, 2003 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 OFFCLSTITLE Creating User AccountsECHO.ECHO Please wait while Windows sets up your user accountsECHO.ECHO Setting up User accountnet user "Cam" 123456 /add /FULLNAME:"Cam" /EXPIRES:never /PASSWORDREQ:yesnet localgroup "Power Users" name /ADDnet localgroup "users" name /DELETEECHO.ECHO.ECHO Removing ASP.NET User Account created by .NET Framework 1.1...net user aspnet /deleteECHO.net user >> "C:\user.log"net user name >> "C:\user.log"net user anothername >> "C:\user.log"EXIT
Aaron Posted August 17, 2003 Posted August 17, 2003 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.
bigred Posted August 17, 2003 Posted August 17, 2003 I'm trying it now, I'll let you know hot it goes (it's installing hotfixes now, won't be too long)...
devil270975 Posted August 17, 2003 Posted August 17, 2003 you dont need quotes around your usernameanother 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 scriptcheck to see if the code works, if it does then put it in your main script, that way no wasted discsyou can allways delete the user from the example i posted earlieri do that to all my scripts to test them including software
devil270975 Posted August 17, 2003 Posted August 17, 2003 AarronXP: net user Administrator /delete will not work xp will not allow you to delete admin accountthere 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.pLee....
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now