From 2435ab4a2e2afacbbd494c1f462da893d8f0a562 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Sun, 19 Jun 2022 16:40:47 +0200 Subject: [PATCH] copy script with new user logic --- 06_Copy2Stick.cmd | 59 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/06_Copy2Stick.cmd b/06_Copy2Stick.cmd index df87607..ec6c63e 100644 --- a/06_Copy2Stick.cmd +++ b/06_Copy2Stick.cmd @@ -2,9 +2,33 @@ set SOURCES=c:\TEMP\W10\sources set BOOT=boot.wim set IMAGE=install.esd +set SETTINGS=settings.cmd +set COMPANY_SETTINGS=company\settings.cmd 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 Prepare USB Stick ... @@ -12,13 +36,6 @@ echo ===================== set USBDRIVE=%1 -if EXIST settings.cmd ( - call settings.cmd -) else ( - set LANG=en-US -) -echo LANG=%LANG% - if /I %USBDRIVE% == C: ( echo ERROR: cannot use drive %USBDRIVE% ! exit /b @@ -53,21 +70,33 @@ set answer= :CONT rem ask for user ... -echo. -set MYUSER=support -set /p MYUSER="Username (%MYUSER%)? " +set MYUSER=testuser +if "@%support_user%" NEQ "@" ( + set MYUSER=%support_user% +) else ( + echo. + set /p MYUSER="Username (%MYUSER%)? " +) echo MYUSER = %MYUSER% rem ask for real name ... -echo. -set MYNAME=Support User -set /p MYNAME="Display Name (%MYNAME%)? " +set MYNAME=Test User +if "@%support_name%" NEQ "@" ( + set MYNAME=%support_name% +) else ( + echo. + set /p MYNAME="Display Name (%MYNAME%)? " +) echo MYNAME = %MYNAME% rem ask for a password ... -echo. 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.