1.

Solve : create/add users in batch file?

Answer»

How do you add a user in a batch file to a group? What do you start off with ? I know only a little, but help me out,
start
net localgroup Administrator "Paul" /add
cls
exit
Any help would be appreciated. Well what i would do is i would make OPTIONS... (havnt coded in .bat files in a while, bear with me)

i would make the first entry where the person would type in their name... then if it DOESNT have a correct entry have it cycle back to the begining

if they do have a correct entry make them input a password... incorrect PASS entry then make them retype the entry... sorta like this(gotta RIFFLE through old files ):

Quote

@echo off
set input=
set /p input="type your name"

if %input%==dan goto dan
if %input%==charlie goto charlie

:dan
set input=
set /p input="type your password"

if %input%==12345 goto logon

:logon
[/quote]

etc...

~Simitra

BTW i wouldnt go completely on that... im still not that good at batch spent too much time on c++
Quote from: tommy gusack on January 24, 2008, 01:30:15 PM
How do you add a user in a batch file to a group? What do you start off with ? I know only a little, but help me out,
start
net localgroup Administrator "Paul" /add
cls
exit
Any help would be appreciated.

yea, you have it right but instead of just putting only one user choice, do sumthing like this:
Code: [Select]@echo off
color a
echo please insert password to use
set /p password=
if '%password%' == 'password' goto accepted Else false goto false
:false
echo im sorry but that was incorrect!!!
pause
goto start

:accepted
echo insert name and press enter
set /p name=
pause
echo same for password
set /p password=

echo name = %name%
echo password = %password%
pause
cls
echo would you like to create account?
echo press any key to create account
pause
net user %name% %password% /add
echo press any key to make it an administrator
pause
net localgroup administrators %name% /add
pause
echo account made!
pause
echo This is a program from Stealth485!
pause
i made this about 2 years ago so its not that advanced, but it is decent


Discussion

No Comment Found