当前位置: 首页 > news >正文

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


 

http://www.lryc.cn/news/371741.html

相关文章:

  • C++中变量的使用细节和命名方案
  • [ACTF新生赛2020]SoulLike
  • C#——析构函数详情
  • 探索重要的无监督学习方法:K-means 聚类模型
  • 将web项目打包成electron桌面端教程(二)vue3+vite+ts
  • Linux下的/etc/resolv.conf
  • 大语言模型 (LLM) 红队测试:提前解决模型漏洞
  • cocos入门11:生命周期
  • c++分辨读取的文件编码格式是utf-8还是GB2312
  • MS721仪表总线(M-Bus)从站收发电路
  • 用Python代码锁定Excel单元格以及行和列
  • 在Lua解释器中注册自定义函数库
  • UKP3D用户定制图框的思路
  • 事务并发问题 与 事务隔离级别
  • 云原生Kubernetes系列项目实战-k8s集群+高可用负载均衡层+防火墙
  • MFC为什么说文档在数据的保存和给用户提供数据之间划分了清晰的界限?
  • SAS:PROC SQL和ANSI标准
  • 使用mysql_config_editor可以为特定的MySQL服务器或客户端程序设置登录路径
  • gridview的模板按钮如何判断用户点击的是哪一行
  • 虚拟化 之三 详解 jailhouse(ARM 平台)的构建过程、配置及使用
  • 数据安全:Web3时代的隐私保护新标准
  • STM32串口不定长接收空闲中断
  • Ubuntu 设置开机启动脚本
  • C# Task 包含 await ConfigureAwait CancellationTokenSource
  • Python数据分析与建模库-02科学计算库Numpy01-05合集
  • 【前端项目笔记】1 登录与登出功能实现
  • 是字符串定义以及在C语言中字符串是如何表示的
  • 辽宁普通测径仪升级智能测径仪后都有哪些改进?
  • 【微信小程序】事件分类以及阻止事件冒泡
  • 踩坑!被node-sass折磨的一天