Update BIOS in WinPE results in not a valid application

lupinlicious 136 Reputation points
2022-06-30T08:53:18.637+00:00

Hello,

I have the following script, which works perfectly fine from inside of Windows, but when I try to run it in WinPE and from the stage of Preinstall in my task sequence nothing happens.
If I place a pause after when it's meant to run and execute it manually it says:

Start-Process : This command cannot be run due to the error: The specified executable is not  
a valid application for this OS platform..  
At X:\BIOS\BIOS\DellBiosUpgradePackage-2.5.ps1:32 char:12  
+ $Process = Start-Process "$PSScriptRoot\$BiosFileName" $BiosArguments ...  
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationExceptio  
   n  
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartPr  
   ocessCommand  

Script starts here#

#Get Bios Password from File  
$BiosPassword = Get-Content .\Bios.txt  

#Create Model Variable  
$ComputerModel = Get-WmiObject -Class Win32_computersystem | Select-Object -ExpandProperty Model  

Copy-Item $ComputerModel\*.exe -Destination $PSScriptRoot  

#Get Bios File Name (Uses the Bios EXE file in the same folder)  
$BiosFileName = Get-ChildItem $ComputerModel\*.exe -Verbose | Select -ExpandProperty Name  

#Get Bios File Name (No Extension, used to create Log File)  
$BiosLogFileName = Get-ChildItem $ComputerModel\*.exe -Verbose | Select -ExpandProperty BaseName  
$BiosLogFileName = "$BiosLogFileName.log"  

#Set Command Arguments for Bios Update /p=$BiosPassword  
$BiosArguments = "/s /p=$BiosPassword /l=$LogPath\$BiosLogFileName"  


$Process = Start-Process "$PSScriptRoot\$BiosFileName" $BiosArguments -Wait -PassThru  

Reason to this is that previous tool Flash64W.exe /b=<BIOS-file> doesn't work with newer Dell models, it says:

Error: Invalid Command Line  
Unrecognized command line option </b>. The /? will show command help  

I'd appreciate any help to accomplish bios update from winpe on newer Dell computers.

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. lupinlicious 136 Reputation points
    2022-06-30T20:28:15.25+00:00

    I almost got it now and flash64w.exe is still working, the only two lines I changed was to this:

    $BiosArguments = " /b=$BiosFileName /s /p=$BiosPassword /l=$LogPath\$BiosLogFileName"  
    
    $Process = Start-Process "$PSScriptRoot\Flash64W.exe" -Argumentlist "$BiosArguments" -Wait -PassThru  
    

    If I manually run the script from WinPE it works, but when I let my task sequence has it moments, it just flashes by and nothing happens.

    In my task sequence I tried with the following: powershell.exe -executionpolicy bypass -windowsstyle hidden file "$SCRIPTROOT\BIOS2\DellBiosUpgrade.ps1" **-wait**

    Or how can I pause this for a few seconds?

    Best regards

    0 comments No comments

  2. lupinlicious 136 Reputation points
    2022-07-01T06:38:06.49+00:00

    This is weird, if I let my task sequence run it ends up with

     Error: Invalid Command Line  
     Unrecognized command line option </b>. The /? will show command help  
    

    But if I run the script manually it works fine.

    Why is it like this?

    0 comments No comments

  3. Limitless Technology 39,926 Reputation points
    2022-07-03T10:11:46.54+00:00

    Hi there,

    If you are using a version of Dell 64BIT BIOS Flash Utility lower than version 3.1.1 then you may receive an "Unsupported System ID" error on certain Dell Models.

    You can download the latest version of the Dell 64BIT BIOS Flash Utility from the Dell Support Website and see if that helps.

    ---------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer--


  4. Logan Crouch 0 Reputation points
    2024-08-27T23:15:17.8833333+00:00

    Try encapsulating the arguments when you pass them to the task sequence. For instance in winpe, set this as your run command line in the task sequence.

    cmd /k "flash64w.exe /b=bios.exe"

    I suspect something about the "/b=" is causing the task sequence to not parse it out correctly. Just had this problem myself and that was the fix.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.