copy script with new user logic

This commit is contained in:
Michael H.G. Schmidt 2022-06-19 16:40:47 +02:00
parent c825355cc1
commit 2435ab4a2e

View File

@ -2,9 +2,33 @@
set SOURCES=c:\TEMP\W10\sources set SOURCES=c:\TEMP\W10\sources
set BOOT=boot.wim set BOOT=boot.wim
set IMAGE=install.esd set IMAGE=install.esd
set SETTINGS=settings.cmd
set COMPANY_SETTINGS=company\settings.cmd
IF %1.==. GOTO USAGE IF %1.==. GOTO USAGE
rem ===================
rem CONFIGFILE CHECK
rem ===================
rem GLOBAL settings ...
if EXIST %SETTINGS% (
call %SETTINGS%
) else (
set LANG=en-US
)
echo LANG=%LANG%
rem COMPANY settings ...
set support_user=
set support_password=
if NOT EXIST %COMPANY_SETTINGS% (
echo INFO: COMPANY %COMPANY_SETTINGS% NOT FOUND
) else (
echo OK. Loading COMPANY settings ...
call %COMPANY_SETTINGS%
)
echo. echo.
echo ===================== echo =====================
echo Prepare USB Stick ... echo Prepare USB Stick ...
@ -12,13 +36,6 @@ echo =====================
set USBDRIVE=%1 set USBDRIVE=%1
if EXIST settings.cmd (
call settings.cmd
) else (
set LANG=en-US
)
echo LANG=%LANG%
if /I %USBDRIVE% == C: ( if /I %USBDRIVE% == C: (
echo ERROR: cannot use drive %USBDRIVE% ! echo ERROR: cannot use drive %USBDRIVE% !
exit /b exit /b
@ -53,21 +70,33 @@ set answer=
:CONT :CONT
rem ask for user ... rem ask for user ...
echo. set MYUSER=testuser
set MYUSER=support if "@%support_user%" NEQ "@" (
set /p MYUSER="Username (%MYUSER%)? " set MYUSER=%support_user%
) else (
echo.
set /p MYUSER="Username (%MYUSER%)? "
)
echo MYUSER = %MYUSER% echo MYUSER = %MYUSER%
rem ask for real name ... rem ask for real name ...
echo. set MYNAME=Test User
set MYNAME=Support User if "@%support_name%" NEQ "@" (
set /p MYNAME="Display Name (%MYNAME%)? " set MYNAME=%support_name%
) else (
echo.
set /p MYNAME="Display Name (%MYNAME%)? "
)
echo MYNAME = %MYNAME% echo MYNAME = %MYNAME%
rem ask for a password ... rem ask for a password ...
echo.
set MYPASS= set MYPASS=
set /p MYPASS="Password (not set)? " if "@%support_password%" NEQ "@" (
set MYPASS=%support_password%
) else (
echo.
set /p MYPASS="Password (not set)? "
)
echo MYPASS = %MYPASS% echo MYPASS = %MYPASS%
echo. echo.