Hello,
I'm trying to update ASUS BIOS, and during the update, the tool "afuwinx64.exe" asks, "System is going to shut down, are you ready? (Y/N)". If I press "Y" the update works but breaks task sequences. If I press "N," means no update, and MDT continue with the task sequence.
Can I add something before the BIOS update so MDT can continue from where it left off?
My task sequence is under State Restore "Custom Tasks," I also tried to add the following command lines before the BIOS update:
cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f
cscript.exe "%SCRIPTROOT%\LTIApply.wsf" /PE /STAGE
cscript.exe "%SCRIPTROOT%\LTIApply.wsf" /PE /BCD
And the BIOS update itself:
New-PSDrive -Name "A" -Root $scriptDirectory -Persist -PSProvider "FileSystem"
$cmdPath = "C:\Windows\System32\cmd.exe"
$command = "/c cd C:\ProgramData\bios & echo Y | afuwinx64.exe Q170M-C-SI-4212.CAP /P /B /N /K /CAPSULE"
$baseboardModel = (Get-WmiObject -Class Win32_BaseBoard | Select-Object -ExpandProperty Product)
$ScriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
$FilesPath = Join-Path -Path $ScriptDirectory -ChildPath "Files"
$ModelPath = Join-Path -Path $FilesPath -ChildPath $baseboardModel
if ($baseboardModel -eq $baseboardModel -and (Test-Path $ModelPath)) {
# Create destination folder if it doesn't exist
$destinationFolder = "C:\ProgramData\bios"
if (!(Test-Path $destinationFolder)) {
New-Item -Path $destinationFolder -ItemType Directory | Out-Null
}
# Copy AFUWINx64.EXE, amifldrv64.sys, and Q170M-C-SI-4212 to the destination folder
$filesToCopy = @("AFUWINx64.EXE", "amifldrv64.sys", "Q170M-C-SI-4212.CAP")
foreach ($file in $filesToCopy) {
$sourcePath = Join-Path -Path $ModelPath -ChildPath $file
$destinationPath = Join-Path -Path $destinationFolder -ChildPath $file
Copy-Item -Path $sourcePath -Destination $destinationPath -Force -Verbose
}
# Get Bios File Name (Uses the Bios ROM file in the model folder)
$BiosFileName = Get-ChildItem -Path $ModelPath -Filter *.CAP -Recurse -Verbose | Select-Object -ExpandProperty Name
# Get Bios File Name (No Extension, used to create Log File)
$BiosLogFileName = (Get-ChildItem -Path $ModelPath -Filter *.CAP -Verbose | Select-Object -ExpandProperty BaseName) + ".log"
# Set Command Arguments for BIOS Update
$exeName = Join-Path -Path $destinationFolder -ChildPath "AFUWINx64.EXE"
$ROMName = Get-ChildItem -Path $destinationFolder -Include "*.CAP" -Name
$logFilePath = Join-Path -Path $destinationFolder -ChildPath "Files\$deviceID.log"
$parameters = "/P /B /N /K /CAPSULE"
Set-Location -Path $destinationFolder
#Execute-Process -Path $exeName -Parameters $ROMName, $parameters
Start-Process -FilePath $cmdPath -ArgumentList $command -Wait -NoNewWindow
Write-Host "Performing BIOS update for $baseboardModel."
}
else {
Write-Host "No BIOS update required for the detected baseboard model: $baseboardModel."
}
I'm also struggling with "Echo Y", I want it to say "Yes" in the prompt automatically.
Thaaaanks!