:: *****************************************************************************************************************************************************************
:: 20231229
:: 该脚本可以用于机台使用Dash方式去跑ACPI时使用.
:: 在安装dash客户端时,先运行此脚本,则可以自动为系统设置密码和自动在注册表添加自动登陆功能.
:: 安装dash客户端后,测试机将在5秒后自动重启.
:: 注意:要把"dash_client_installer.1.0.8"文件夹放到OS desktop,才能直接运行该脚本.不然则要修改脚本有关dash客户端的对应路径.
:: 作者: Darren Zhang
:: *****************************************************************************************************************************************************************
@echo off
:start
echo Please enter the following items to run:
echo 1. Default Settings
echo 2. Custom setting
echo 3. Exit
echo.
echo Your options are :
set /p id=
if "%id%"=="1" goto DS
if "%id%"=="2" goto CS
if "%id%"=="3" goto Exit
cls
echo.
echo Your input is incorrect,Please re-select the item to run.
cls
goto start
:DS
echo ****** The password of the current user is set to "dell1234"! ******
net user %username% dell1234
echo ****** Add "DefaultPassword" and "DefaultUserName" with "dell1234" and "%username%" respectively to the registry! ******
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d %username% /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d dell1234 /f
goto IDC
:CS
echo ******Please enter the SUT name:******
set /p usernamecs=
echo ******Please enter the password you want to set:******
set /p password=
net user %username% %password%
echo ******Change the "Default Password" and "Default User Name" value to the above custom values in the registry******
set "key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon""
set "valueDU=DefaultUserName"
set "valueDP=DefaultPassword"
set "data=%password%"
reg add %key% /v %valueDU% /t REG_SZ /d %usernamecs% /f
reg add %key% /v %valueDP% /t REG_SZ /d %data% /f
goto IDC
:IDC
cls
echo.
echo ****** Please determine whether dashClient is installed ("Press Y for Yes, N for No"): ******
CHOICE /C YN
if errorlevel 2 goto Pause
rem Define the application installation path
set Intall_path="C:\Users\%username%\Desktop\dash_client_installer.1.0.9"
cd %Intall_path%
echo ****** Install applications sequentically ******
call dashClientInstaller.cmd
echo ****** Dash Client has been installed and SUT will restart automatically after 5 seconds !!! ******
shutdown /r /t 5
goto Pause
:Exit
exit
:Pause
pause