Jump to content

Multi User Acount And Cmdlines.txt


Recommended Posts

I am about to try the add users from the Cmdlines.txt, I under stand the idea behind it what I need to know is this I have done a search of ADD USER and could not find any thing about this.

This I know Is Correct Exact Copy From The Main Help Page With My Info Added

net user Gunsmokingman WHATEVER /add

net localgroup Administrators Gunsmokingman /add

net accounts /maxpwage:unlimited

This is what i want to know about is this correct

net user Natasha WHATEVER /add

net localgroup User Natasha /add

net accounts /maxpwage:limited

I have 2 admin accounts and 2 User Accounts To Add. Here My User Accounts Script I have it so it will out put but not do any other action.

echo off

cls

mode con: Cols=55 Lines=5

color 9F

Title Adding Users To Computer

>> %SYSTEMDRIVE%\REST1.vbs Echo Wscript.sleep 925

SET R1=Start /w %SYSTEMDRIVE%\Rest1.vbs

SET SD=%SYSTEMDRIVE%

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]> %SD%\GmanUser.reg

echo "DefaultUserName"="Gunsmokingman" >> %SD%\GmanUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\GmanUser.reg

echo "AutoAdminLogon"="1" >> %SD%\GmanUser.reg

CLS

COLOR 1F

ECHO.

ECHO WAIT PROCESSING USER 1.

%R1%

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > Jasmine_Of_KentUser.reg

echo "DefaultUserName"="Jasmine_Of_Kent" >> %SD%\Jasmine_Of_KentUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\Jasmine_Of_KentUser.reg

echo "AutoAdminLogon"="1" >> %SD%\Jasmine_Of_KentUser.reg

CLS

COLOR 2F

ECHO.

ECHO WAIT PROCESSING USER 2..

%R1%

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > %SD%\NatashaUser.reg

echo "DefaultUserName"="Natasha" >> %SD%\NatashaUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\NatashaUser.reg

echo "AutoAdminLogon"="1" >> %SD%\NatashaUser.reg

CLS

COLOR 4F

ECHO.

ECHO WAIT PROCESSING USER 3...

%R1%

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > %SD%\NicciUser.reg

echo "DefaultUserName"="Nicci" >> %SD%\NicciUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\NicciUser.reg

echo "AutoAdminLogon"="1" >> %SD%\NicciUser.reg

CLS

COLOR 5F

ECHO.

ECHO WAIT PROCESSING USER 4....

%R1%

::::::::::::::::::::: MY ERROR TEST

::DEL %SD%\*User.reg

::%R1%

::::::::::::::::::::: MY ERROR TEST

:ConF1

if exist %SD%\GmanUser.reg goto ConF2

:ConF2

if exist %SD%\Jasmine_Of_KentUser.reg goto ConF3

:ConF3

if exist %SD%\NatashaUser.reg goto ConF4

:ConF4

if exist %SD%\NicciUser.reg goto ConF5

::::::::::::::::::::: ERROR RE DO ME

:REDOME

if not exist %SD%\GmanUser.reg goto Recheck1

if not exist %SD%\Jasmine_Of_KentUser.reg goto Recheck1

if not exist %SD%\NatashaUser.reg goto Recheck1

if not exist %SD%\NicciUser.reg goto Recheck1

::::::::::::::::::::: ERROR RE DO ME

:ConF5

cls && color 3f && echo. && echo Registry Files Out Put Completed! && %R1%

GOTO WORK1

::::::::::::::::::::: ERROR RECHECK 1

:Recheck1

CLS

COLOR FC

TITLE RECHECK 1

ECHO.

ECHO PREPARING TO RECHECK OUTPUT

%R1%

:F0

IF EXIST %SD%\GmanUser.reg goto F1

ECHO.

IF NOT EXIST %SD%\GmanUser.reg goto OPS

:::::::

:F1

if exist %SD%\Jasmine_Of_KentUser.reg goto F2

IF NOT EXIST %SD%\Jasmine_Of_KentUser.reg goto OPS1

:::::::

:F2

if exist %SD%\NatashaUser.reg goto F3

IF NOT EXIST %SD%\NatashaUser.reg goto OPS2

:::::::

:F3

if exist %SD%\NicciUser.reg goto ConF5

IF NOT EXIST %SD%\NicciUser.reg goto OPS3

:::::::

:OPS

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > %SD%\GmanUser.reg

echo "DefaultUserName"="Gunsmokingman" >> %SD%\GmanUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\GmanUser.reg

echo "AutoAdminLogon"="1" >> %SD%\GmanUser.reg

GOTO F1

:::::::

:OPS1

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > Jasmine_Of_KentUser.reg

echo "DefaultUserName"="Jasmine_Of_Kent" >> %SD%\Jasmine_Of_KentUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\Jasmine_Of_KentUser.reg

echo "AutoAdminLogon"="1" >> %SD%\Jasmine_Of_KentUser.reg

GOTO F2

:::::::

:OPS2

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > %SD%\NatashaUser.reg

echo "DefaultUserName"="Natasha" >> %SD%\NatashaUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\NatashaUser.reg

echo "AutoAdminLogon"="1" >> %SD%\NatashaUser.reg

GOTO F3

:::::::

:OPS3

echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] > %SD%\NicciUser.reg

echo "DefaultUserName"="Nicci" >> %SD%\NicciUser.reg

echo "DefaultPassword"="WHATEVER" >> %SD%\NicciUser.reg

echo "AutoAdminLogon"="1" >> %SD%\NicciUser.reg

ECHO.

ECHO WAIT PROCESSING RE DO ME......

%R1%

::::::::::::::::::::: END OF RE DO ME GOING TO WORK 1

ECHO OFF && cls && color F2 && TITLE RE DO ME COMPLETED? && echo. && echo THIS MEANS FIRST OUT PUT FAILED!

echo. && echo THIS IS THE RE DO ME OUT PUT! && echo. && %R1%

%R1%

GOTO WORK1

::::::::::::::::::::: ERROR RECHECK 1

::::::::::::::::::::: WORK 1

:WORK1

CLS

COLOR F3

TITLE ADD ALL USERS

SET /P = tEST PRESS KEY TO GO ON:

GOTO QUIT

::::::: USER 1

net user Gunsmokingman WHATEVER /add

net localgroup Administrators Gunsmokingman /add

net accounts /maxpwage:unlimited

::::::: USER 2

net user Jasmine_Of_Kent WHATEVER /add

net localgroup Administrators Jasmine_Of_Kent /add

net accounts /maxpwage:unlimited

::::::: USER 3

net user Natasha WHATEVER /add

net localgroup User Natasha /add

net accounts /maxpwage:limited

::::::: USER 4

net user Nicci WHATEVER /add

net localgroup User Nicci /add

net accounts /maxpwage:limited

::::::::::::::::::::: WORK 1

::::::: REG PART

REGEDIT /S %SD%\GmanUser.reg

REGEDIT /S %SD%\Jasmine_Of_KentUser.reg

REGEDIT /S %SD%\NatashaUser.reg

REGEDIT /S %SD%\NicciUser.reg

:QUIT

DEL %SD%\*.reg

DEL %SD%\REST*.VBS

ping -n 3 127.0.0.1>Nul | Echo Completed Adding Users?

EXIT

All I need to know is the User Accounts And There Levels Are Correct.

Also AutoLogon If I leave Mine At 1 and the rest at 0 would that be correct.

I Gunsmokingman give all users full permission to do what ever they want with this script.

UserAcounts.cmd

Link to comment
Share on other sites


I believe you can set a maximum password age from the command line as such:

net accounts /maxpwage:XX

Where XX is the maximum password age in days.

I also believe this to be a system-wide setting, so I don't think you will be able to set maximum ages of different lengths for the various accounts. There is an option to set "Password never expires" on specific accounts which will bypass the maximum password age setting that you can use if you want one or more accounts to have permanent passwords.

Edit: It is also not necessary to add users to the Users group once you have created them. New users are made members of this group by default when they are created via the net user command.

Edited by Cartoonite
Link to comment
Share on other sites

Thanks For The Reply

So I dont Have To Set The User Level

To Users It Set There By Defualt.

Here Is A Template To Make A UserAccount.cmd

It Has 3 Inputs

1\ Name

2\ PassWord

3\ AutoLogon

The Level Set At Admin

It Produces This CmdLines.txt This Will

Open Up In NotePad. This Is to Allow For

You To Add Your Own Entries.

[COMMANDS]"User1.cmd"
Green Are The User Inputs

Dim FS, FSO, Folder ,USER1 , USER2 ,USER3

Dim Shell, AP, UP, SD, SP, Wd

V = Vbcrlf

Set Shell = WScript.CreateObject("WScript.Shell")

AP = Shell.ExpandEnvironmentStrings("%AllUsersProfile%")

UP = Shell.ExpandEnvironmentStrings("%UserProfile%")

SD = Shell.ExpandEnvironmentStrings("%SystemDrive%")

SP = Shell.ExpandEnvironmentStrings("%SystemDrive%\Program Files")

WD = Shell.ExpandEnvironmentStrings("%Windir%\")

USER1 = InputBox(space(12) & "USER NAME" & V &"Please Type In The User Name" & V &_

"This Is A Admin Account Level",space(12) & "USER NAME","",5500,5500)

USER2 = InputBox(space(12) & "PASSWORD" & V &"Add Your PassWord To The Account" & V &_

"Please Remeber Your Pass Word.",space(12) & "PASSWORD","",5500,5500)

USER3 = InputBox(space(12) & "AUTOLOGON" & V &"Add How Many Times You Want To " & V &_

"Auto Logon, Without Using The Pass Word.",space(12) & "AUTOLOGON","",5500,5500)

Set fs = CreateObject("Scripting.FileSystemObject")

strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", SD & "User1.cmd")

strFileName = fs.GetAbsolutePathName(strFileName)

Set ts = fs.OpenTextFile(SD & "User1.cmd", 2, True)

ts.WriteLine "echo off"

ts.WriteLine "cls"

ts.WriteLine "mode con: Cols=55 Lines=5"

ts.WriteLine "color 9F"

ts.WriteLine "Title Adding Users To Computer"

ts.WriteLine ">> %SYSTEMDRIVE%\REST1.vbs Echo Wscript.sleep 925"

ts.WriteLine "SET R1=Start /w %SYSTEMDRIVE%\Rest1.vbs"

ts.WriteLine "SET SD=%SYSTEMDRIVE%"

ts.WriteLine "echo."

ts.WriteLine "Echo Processing Wait.."

ts.WriteLine "%R1%"

ts.WriteLine "%R1%"

ts.WriteLine "ECHO [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]>> %SD%\User.reg"

ts.WriteLine "echo ""DefaultUserName""=""" & User1 & """ >> %SD%\User.reg"

ts.WriteLine "echo ""DefaultPassword""=""" & User2 & """ >> %SD%\User.reg"

ts.WriteLine "echo ""AutoAdminLogon""=""" & User3 & """ >> %SD%\User.reg"

ts.WriteLine "CLS"

ts.WriteLine "Echo Processing Wait.."

ts.WriteLine "%R1%"

ts.WriteLine "::::::::START CHECK"

ts.WriteLine ":ConF1"

ts.WriteLine "if exist %SD%\User.reg goto ConF5"

ts.WriteLine ":REDOME"

ts.WriteLine "if not exist %SD%\User.reg goto Recheck1"

ts.WriteLine ":ConF5"

ts.WriteLine "cls"

ts.WriteLine "color 3f"

ts.WriteLine "echo."

ts.WriteLine "echo Registry Files Out Put Completed!"

ts.WriteLine "%R1%"

ts.WriteLine "GOTO WORK1"

ts.WriteLine "::::::::RECHECK"

ts.WriteLine ":Recheck1"

ts.WriteLine "CLS"

ts.WriteLine "COLOR FC"

ts.WriteLine "TITLE RECHECK 1"

ts.WriteLine "ECHO."

ts.WriteLine "ECHO PREPARING TO RECHECK OUTPUT"

ts.WriteLine "%R1%"

ts.WriteLine ":F0"

ts.WriteLine "IF EXIST %SD%\User.reg goto ConF5"

ts.WriteLine "IF NOT EXIST %SD%\User.reg goto OPS"

ts.WriteLine ":OPS"

ts.WriteLine "ECHO [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> %SD%\User.reg"

ts.WriteLine "echo ""DefaultUserName""=""" & User1 & """ >> %SD%\User.reg"

ts.WriteLine "echo ""DefaultPassword""=""" & User2 & """ >> %SD%\User.reg"

ts.WriteLine "echo ""AutoAdminLogon""=""" & User3 & """ >> %SD%\User.reg"

ts.WriteLine "CLS"

ts.WriteLine "Echo Processing Wait.."

ts.WriteLine "%R1%"

ts.WriteLine "GOTO WORK1"

ts.WriteLine ":::::::END OF THE CHECK AND OUT PUT"

ts.WriteLine ":WORK1"

ts.WriteLine "CLS"

ts.WriteLine "COLOR F3"

ts.WriteLine "TITLE ADD ALL USERS"

ts.WriteLine "::::::: USER 1"

ts.WriteLine "net user " & user1 & SPACE(1) & User2 & "/add"

ts.WriteLine "net localgroup Administrators " & user1 & "/add"

ts.WriteLine "net accounts /maxpwage:unlimited"

ts.WriteLine "::::::::::::::::::ADDING THE REG"

ts.WriteLine "REGEDIT /S %SD%\User.reg"

ts.WriteLine ":QUIT "

ts.WriteLine "DEL %SYSTEMDRIVE%\User.reg"

ts.WriteLine "DEL %SYSTEMDRIVE%\REST*.VBS"

ts.WriteLine "Echo Completed Adding Users?"

ts.WriteLine "ping -n 3 127.0.0.1>nul"

ts.WriteLine "exit"

ts.Close

Set FS = CreateObject("Scripting.FileSystemObject")

strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", SD & "cmdlines.txt")

strFileName = fs.GetAbsolutePathName(strFileName)

Set CL = FS.OpenTextFile(SD & "cmdlines.txt", 2, True)

CL.WriteLine "[COMMANDS]"

CL.WriteLine """User1.cmd"""

CL.Close

wscript.sleep 150

GSM = Msgbox ("The Location Of The Files : " & SD & V & "Preparing To Clean Up", 0 + 64,"Thank You For Using This Gsm")

Set sh = CreateObject("WScript.Shell")

sh.Run (SD & "cmdlines.txt")

ON ERROR RESUME NEXT

Set fso = CreateObject("Scripting.FileSystemObject")

fso.DeleteFile( SD & "UserAccounts.vbs")

msgbox "clean Up Completed?", 0 + 48, "Good-Bye"

wscript.quit

I Gunsmokingman give all users full permission to do what ever they want with this script.

UserAccounts.exe

Edited by gunsmokingman
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...