Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding users

Featured Replies

Hi, I wanted to add users, however, I wanted the username to be chosen by the installer. And since I didn't know how to do it, I made a batch file.

The file I made look like this:

CLS
@ECHO OFF
Title Create User
COLOR 0A
CLS
ECHO Please type the name of the user, which you want to be created.
start /w wscript.exe "C:\user.vbs"
call "C:\~user.cmd"
del "C:\~user.cmd"
del "C:\user.vbs"
net user %user% /add
net localgroup Administrators %user% /add
net accounts /maxpwage:unlimited

Then, I want to add Autologon, but to be able to use %user% variable, it must be in the batch file (haven't tested it, but I think so).

So is there a kind person who would convert this to REG ADD command?

Windows Registry Editor Version 5.00 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultUserName"="%user%"
"AutoAdminLogon"="1"

Thanks!

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "DefaultUserName" /t REG_SZ /d "%user%" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /t REG_SZ /d "1" /f

As jbm has already answered your request, for tutorial purposes, here's an example of how you would ask for the names etc in a batch file

@echo off&setlocal enableextensions

:: If the account needs a password, enter it after the equals symbol below
:: If the account doesn't require a password leave it blank
:: if you use spaces please do not start or end with them

set newpword=

:: Which type of account group would you like for this user
:: Users is the default if left blank
:: If you wish to change it enter your group after the equals symbol below
:: examples
:: Administrators
:: Backup Operators
:: Guests
:: HelpServicesGroup
:: Network Configuration Operators
:: Power Users
:: Remote Desktop Users
:: Replicator
:: Users

set accntype=

:: You need make no changes below here...

:AddFull
set realname=
echo/ Please enter your full name...
set /p realname=
if '%realname%' equ '' goto AddFull
echo/ Your full name is %realname%
set /p answr=Is this correct Y/N?
set answr=%answr:~0,1%
if /i '%answr%' neq 'y' goto AddFull

:LogiName
cls
set nickname=
echo/ Please enter the login name you wish to use...
set /p nickname=
if '%nickname%' equ '' goto LogiName
echo/ Your login name is %nickname%
set /p answr=Is this correct Y/N?
set answr=%answr:~0,1%
if /i '%answr%' neq 'y' goto LogiName
echo/ Thank you %realname%

IF '%newpword%' EQU '' (
NET USER "%nickname%" /ADD /fullname:"%realname%" /passwordreq:no
) else (
echo/ YOUR PASSWORD IS %newpword%
echo/
echo/ IMPORTANT the password is case sensitive
echo/ please make a note of it, you will need
echo/ it in order to gain access to this PC!
pause
NET USER "%nickname%" "%newpword%" /ADD /fullname:"%realname%"
)
IF '%accntype%' equ '' (
NET LOCALGROUP Users "%nickname%" /ADD
) else (
NET LOCALGROUP "%accntype%" "%nickname%" /ADD
)
NET ACCOUNTS /MAXPWAGE:UNLIMITED
endlocal&goto :eof

Edited by Yzöwl

  • Author

Thank you very much jbm! :thumbup

Ok, so it is "set /p something=". Thx. However it looks better with the vbs script, I have now completely hidden the cmd file, with "cmdow @ /HID". :)

Thanks again to both of you!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.