欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 艺术 > RunMe_About PreparationForDellBiosWUTTest

RunMe_About PreparationForDellBiosWUTTest

2024/10/24 7:23:09 来源:https://blog.csdn.net/m0_70495771/article/details/139650101  浏览:    关键词:RunMe_About PreparationForDellBiosWUTTest

:: *****************************************************************************************************************************************************************
:: 20240613
:: 该脚本可以用作BIOS WU测试前的准备工作,包括:自动检测"C:\DellBiosWUT\"路径是否存在;"Capsule files"的创建;"Certificate"的安装;"BIOS recovery file"的自动删除;"test signing"状态的开启.
:: 注意: 因有些文件权限问题,最好使用超级管理员CMD窗口运行该脚本;如果运行过程中遇到问题,可以通过重启系统或删除所有生成的文件后再次运行该脚本.
:: 作者: Darren Zhang
:: *****************************************************************************************************************************************************************


@echo off

echo.
echo ************************************** Check whether the "C:\DellBiosWUT\" path exists **************************************
echo.
IF EXIST C:\DellBiosWUT\ (echo The "C:\DellBiosWUT\" path exists ! && echo. && start C:\DellBiosWUT && goto CFC) ELSE (echo The "C:\DellBiosWUT\" path does not exist ! && echo. && goto ACDFST)

:ACDFST
echo.
echo **************************** Automatically copies 'DellBiosWUT' from server to 'C:\DellBiosWUT\' ****************************
echo.
:: echo Copy 'DellBiosWUT' folder from server "\\172.17.1.222\Test Tools\BIOS\Common Tool\" to 'C:\DellBiosWUT\' and open it.
rem xcopy /E /Y "\\172.17.1.222\Test Tools\BIOS\Common Tool\DellBiosWUT" C:\DellBiosWUT\ >nul
xcopy /E /Y "\\172.17.1.222\Test Tools\BIOS\Common Tool\DellBiosWUT" C:\DellBiosWUT\
start C:\DellBiosWUT
echo.

:CFC
echo *********************************************** Capsule files creation *******************************************************
echo.
echo [* Now pls manually copy the latest/current BIOSCapsule/WU files- firmware.bin and firmware.inf to C:\DellBiosWUT. *]
Choice /M "Whether to complete file replication: "
if %ERRORLEVEL%==1 (goto CWAFE) else (goto CFC)
echo.

:CWAFE
echo.
echo [*] Check whether all files exist [*] 

IF EXIST C:\DellBiosWUT\firmware.bin (
    IF EXIST C:\DellBiosWUT\firmware.inf (
        goto RTBCFC
    ) ELSE (
        echo The firmware.inf file does not exist ! && echo. && goto CFC
    )
)
IF EXIST C:\DellBiosWUT\firmware.inf (
    IF EXIST C:\DellBiosWUT\firmware.bin (
        goto RTBCFC
    ) ELSE (
        echo The firmware.bin file does not exist ! && echo. && goto CFC
    )
)
IF NOT EXIST C:\DellBiosWUT\firmware.inf (
    IF NOT EXIST C:\DellBiosWUT\firmware.bin (
        echo firmware.bin/firmware.inf neither file exist ! && echo. && goto CFC
    )
)
 
:RTBCFC
echo firmware.bin/firmware.inf both files exist !    
echo.
:: echo Ready to begin capsule files creation
echo.
echo [* Pls enter your desired capsule files name.(EG.D13CSB1150) *]
set /p CapsuleName=

echo.
echo [*] Start creating capsule files ... [*] 
:: Open another cmd window and enter the relevant instructions (Create a "ForDellBiosWUTest" folder in "C:\DellBiosWUT\", also unzip the generated Capsule .exe file to "ForDellBiosWUTest" folder ), then close the cmd windows.
rem start /WAIT cmd.exe /k "cd C:\DellBiosWUT && createwupkgNew.bat %CapsuleName%.exe && echo Pls select or create a folder to extract the generated files ! && %CapsuleName%.exe && exit"
start /WAIT cmd.exe /k "cd C:\DellBiosWUT && createwupkgNew.bat %CapsuleName%.exe && IF EXIST C:\DellBiosWUT\ForDellBiosWUTest (rd /s /q "C:\DellBiosWUT\ForDellBiosWUTest") ELSE (mkdir "ForDellBiosWUTest") && echo Pls select the 'C:\DellBiosWUT\ForDellBiosWUTest\' folder to extract the generated files ! && %CapsuleName%.exe && exit"
echo Complete the generation of capsule files !
echo.

echo *********************************************** Certificate install *******************************************************
echo.
echo Notes: Pls select the "Local Machine" and select "Next". Select the "Place all certificates in the following store".Select "Browse" then locate/select the "Trusted Root Certification Authorities" and select "Ok".Select "Next". Select "Finish" and confirm with "Yes".
start /WAIT cmd.exe /k "cd C:\DellBiosWUT\ForDellBiosWUTest && fwu.cer && exit"
start C:\DellBiosWUT\ForDellBiosWUTest
echo.
echo Complete the certificate install !
echo.

echo ****************************************** BIOS Recovery files from HDD cleared ********************************************
echo.
start cmd.exe /k "mountvol h: /s && H: && cd H:\EFI\Dell\bios\recovery && del /s H:\EFI\Dell\bios\recovery\* && start H:\EFI\Dell\bios\recovery && exit"
ping 127.0.0.1 -n 12 >nul

echo BIOS Recovery files from HDD cleared success!
echo.

echo *********************************************** Enable test signing *******************************************************
echo.
echo [*] Disable driver enforcement and disabled driver signing ... [*] 
bcdedit -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit -set TESTSIGNING ON

echo.
echo Disable driver enforcement and disabled driver signing success!
echo.

start cmd.exe /k "mode con cols=112 lines=20 && COLOR 0C && title WARM PROMPT && echo IMPORTANT NOTE: && echo Please remember to manually disable test signing through below command after the test !!!!!! && echo "bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS ; bcdedit -set TESTSIGNING OFF" "

echo *************************************** SUT will restart automatically after 12 seconds !!! ********************************
shutdown /r /t 12
pause

:END
exit


 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com