Dell Bios Upgrade in OSD WinPE x64

Update 3/17 – Update a couple sections to fix Bug in Script with assistance from the Dell BIOS Dev team. Uploaded the TS Export of this section.

Download Here:  3/24 – Removed all of the Bios Files and Update Utility to comply with Dell’s EULA.

Task Sequence Export HERE – You can import this into your system and it will have all the steps., Then copy the steps into your working TS.  No Content is included in this export.  Create your own Package with the “Full Folder Structure Download” and link to that in your TS


Original Post:

Ok, So for a long time, You couldn’t upgrade Dell’s Bios in WinPE x64 because they didn’t have native x64 bios installer, this has recently changed. – Download HERE
Mike wrote up a nice intro to the new utility HERE

I do all of our bios updates using the “Application Model” after the OS is laid down, so it has the 32bit subsystem, it works fine. But I know many people like to do it during PE.  So I thought I’d play with it this morning and write up a script.

PreReqs for my script: Enabled PowerShell.  Here are the things we’ve enabled: (Win10 1607 Boot Media)

Benefits of doing it how I’ve setup.

  1. One Script works for all models, you just have to setup your folder structure to match the Computer Model in WMI.
  2. Grabs Bios Password from File, you only have to update one File if you change your Bios Password
  3. Creates TS Variables to avoid Rebooting if already on same bios version.
  4. Creates Log file based on the Bios Update in the %temp%\SMSTSLog Folder (X:\windows\temp\SMSTSLog\BiosFileName.log)
  5. New Bios version release? No Problem, delete the old one, add the new one, update Package, done, no script change required.
  6. It’s Fun

Package Folder Structure.  Make sure the subfolders exactly match the WMI Model Name
Get-WmiObject -Class Win32_computersystem | Select-Object -ExpandProperty Model


Once you’ve created your Folder Structure, populate it with the latest Bios files for each model. (Just download and place in the folder, no renaming required)
Also, create a txt file in the package root called Bios.txt and put your Dell Bios password in that file.

Now, the PowerShell script will query WMI for the Model, look for the bios file inside of the corresponding folder and apply it to the system using the Flash64w.exe utility. (It will pull the password from the bios.txt file in the root of your package)

Updated Script from 3/17 Shown HERE:

Based on the Exit Code of the Bios Update, it will create a TS Variable you can use to reboot, retry if low battery or continue on with your TS. – More info about Dell Exit Codes here… I noticed it didn’t have them all though:  I trigger events based on Exit Code 2 (Successful but requires Reboot) and Exit Code 10 (Battery too Low).  You can easily add additional Exit Codes and create custom variables to have your TS do other thing based on those Exit codes.

Now in your TS:
Create Dell Upgrade Bios Group, and set to only run if a Dell Computer:
select * from Win32_ComputerSystem where Manufacturer like "%Dell%"
Create Run Command Line Step:
powershell.exe -NoProfile -ExecutionPolicy ByPass -file .\DellBiosUpgradePackage-2.0.ps1

Create another Group, This will run if the battery was too low to update the Bios.  It will wait 10 minutes and try again.  If the Battery is still too low after that Point, it will continue on without updating Bios. – You can easily put a step here that will popup a message box about how the Bios Didn’t update, etc.
SMSTS_BiosUpdateBatteryCharge = True
Command Line Step: powershell.exe -NoProfile -ExecutionPolicy ByPass -Command "Start-Sleep -s 600"

It will then wait 10 minutes and try again, if successful, it will set variable SMSTS_BiosUpdateRebootRequired = true and continue onto the next group to reboot.  If it fails due to battery again, it will set SMSTS_BiosUpdateBatteryCharge = True and show a Message that it probably has faulty battery.  At this Point, you can click “OK” and let it continue, or turn it off and replace battery.


Create another Group which will reboot the computer and any other steps needed to get back to where you were before the reboot. (TS Variable = SMSTS_BiosUpdateRebootRequired equals true)
I added a “Format” step, just to ensure there was a place for the Boot Image to download too, this might not be needed in your environment depending on placement of the Bios Upgrade.

Ok, that should be it.

Note, I was running into some issues with the flashw64.exe utility from Dell, getting this error:

Once I added another line into the script to launch the software once with minimal arguments, it worked fine. I’ve contacted Dell Support to see if they have any ideas on that.

This is the line I added to fix that error:
start-process "$PSScriptRoot\Flash64W.exe" /"p=$BiosPassword /s"

However, changing the Argument Line & Update Bios lines fixed the issue, and I haven’t needed that.  I’ve heard from commenters that people are still getting that message, so hopefully this will help. If you do get that message, Open a support issue with Dell, they will help address it.  FYI, I’m also using WinPE 1607, not sure if the Build has anything to do with that error.

Update: 2/27/17 – Response from Dell:
Hello, Gary: I heard back from the BIOS engineering group. They said that they have not tested the utility using Powershell scripts. They do not support Powershell scripts. They only support use of the utility within a command prompt in Windows… It is also supported within WinPE (in a command prompt).

Update 2/28/17 – Call From Dell, they are escalating the issue to the BIOS engineering group and will be looking into the problem to see if they can resolve the issue when using it in PowerShell.

Update 3/17/17 – After working will BIOS Dev team, was able to rework the script to resolve the error I was seeing.  Updated Script in Download and in this Blog Post.

If you run into any problems, let me know and I’ll test that model if I have it.
Tested on so Far:

  1. Laptops
    1. Latitude E5550
    2. Latitude E5470
    3. Latitude E6540
    4. Latitude E6530
    5. Latitude E6430
    6. Latitude E7250
    7. Latitude E7240
    8. Precision 7510
  2. Desktops
    1. OptiPlex 7010

41 thoughts on “Dell Bios Upgrade in OSD WinPE x64

  • February 25, 2017 at 5:01 am

    Many thanks for alerting me to this post and new tool Gary! 🙂

    We've recently swiched over to all Dell clients from HP and so far it's been a 'two-step' process for me build OOB machines. I built a "tools winpe" that includes the cctk that updates the BIOS and updates all the settings fine - but then have to boot into MDT to do the all rest. If I tried to do the same within the task sequence (WinPE section or after OS install) the bios update broke the task sequence due to it auto rebooting to install. Hopefully this new tool will stop me having to do this 🙂

    Best wishes

  • March 19, 2017 at 11:20 pm

    thx for sharing,
    Is it possible to compare version installed if find older then execute this? other wise it will always run...or maybe i have read wrong...

    thx again for sharing.

  • Pingback: Dell BIOS update–WinPE–Model Independent–From Internet – GARYTOWN ConfigMgr Blog

  • March 24, 2017 at 12:10 pm

    Thanks for the Post.
    I get an error when I try to import the Task Sequence
    Failed to load class properties and qualifiers for class BDD_UsePackage in task sequence

    • March 24, 2017 at 12:22 pm

      Do you have MDT integrated? This is an MDT Integrated TS export.

  • March 31, 2017 at 2:01 pm

    No my Company has not Integrated MDT

  • April 19, 2017 at 12:08 pm

    What if there is not any BIOS password set for the machine.
    I tried the same approach in my lab and I received the error 0x80070002. The system cannot find the file specified. I have made sure to create the exact folder structure and distributed the package over DP. The only difference is I don't have any BIOS password so kept the BIOS.txt as blank.
    Any suggestion or should removing the BIOS password parameter from the script is the only solution?

  • May 19, 2017 at 9:22 am

    Really great job!

    I have done some quick friday modification to it so it checks if the folder exists before it continues the script and also to compare the versions before it runs, but it requires that you rename the .exe file so it just contains the version number. Now it only updates if the current bios version is less than the "filename".

    Check below:

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

    # Test path
    $PathExist = Test-Path .\$ComputerModel

    if ($PathExist -eq "True"){
    # Create Bios Variables
    $BiosCurrentVersion = Get-WmiObject -Class Win32_bios | Select-Object -ExpandProperty SMBIOSBIOSVersion
    $BiosUpgradeVersion = Get-ChildItem $ComputerModel\*.exe -Verbose | Select -ExpandProperty BaseName

    if ($BiosCurrentVersion -lt $BiosUpgradeVersion){
    # Copy Bios Installer to the root of the package - the Flash64W didn't like when I left it in the Computer Model folder, because it has spaces. (Yes, I tried qoutes and stuff)
    Copy-Item $ComputerModel\*.exe -Destination $PSScriptRoot

    # Set Command Arguments for Bios Upgrade
    $cmds = "/b=$BiosUpgradeVersion.exe /f /s /p=$BiosPassword /l=$LogPath\$BiosUpgradeVersion.log"

    # Upgrade Bios
    $Process = start-process $PSScriptRoot\Flash64W.exe -ArgumentList $cmds -PassThru -wait

  • May 23, 2017 at 9:29 am

    Another winner. Thanks. I'm running mine with the Run PowerShell Script action instead of Run Command Line because I was getting an unknown error.

  • June 1, 2017 at 1:57 pm

    Is there a way to get a Version number out of the Dell Bios files (like A20 or 1.3.3) so I can compare it with the current System Bios version?

    • June 5, 2017 at 12:11 pm

      You can probably pull that info from the file name itself, but I haven't had time to look into that. I just run it even if it is updated, as it won't update if it's already current.

  • June 5, 2017 at 2:27 pm

    I can't seem to get this to work, I keep getting the memory could not be read error.

    Can you specify what you did to get it to work? I haven't even been able to get flashw.exe to run on its own using cmd.

    Any help would be appreciated. Thanks!

    • June 7, 2017 at 9:11 am

      I updated the Post to include info I used to resolve that error the first time. The updated Script I was using resolved it for me, but if you're having the problem, then hopefully adding that one line will solve it for you. Please also then contact Dell Support to see if you can get it resolved without that workaround. If there is a problem with the Dell 64 flash tool, then it's good to get them in the loop.

  • June 8, 2017 at 4:27 am

    Hi Gary, thanks for this.

    Question: What if the computer to be updated, needs more than 1 BIOS upgrade? You said "Once you’ve created your Folder Structure, populate it with the latest Bios files for each model." But, in my testing, I saw computer needed 2 different updates (as they dont seem to be "cumulative")

    Thank you.

    • June 8, 2017 at 6:39 am

      If you had models that required multiple steps, you could do this a couple ways. You can get the pre-req updates installed manually ahead of time, or you can create additional steps for those models. Basically create an identical package to the one I've listed, then create another step using the Pre-Req Package, which has all of the models that require a pre-req update, and have several variables on the Step, so it only runs if it is Latitude E6510 or E6410, and is A17 or lower, etc. (I have not tested this, as everything I have is already past that point that I need pre-req updates)

      Here is more info:

  • June 14, 2017 at 2:37 pm

    How many versions can we jump up on our machines at one time? We have machines that were deployed with versions from 1.2.2 to 1.11.3. Can we go straight to the current BIOS or do we still need to increase the version by no more than 3 updates till we get back to current?
    Thank you

    • June 14, 2017 at 4:22 pm

      George, you can go straight to the latest version. Dell Bios have checks built in, if it does require a pre-req bios, it will let you know. Don't make extra work for yourself, always go straight to the latest, if you ever find something that didn't work right, open support case with Dell, they want to know, because it should be easy to update.

  • August 3, 2017 at 2:31 pm

    What in case if the upgrade process requires a two level. For example - If my current BIOS version is 1.2.4 and I need to upgrade to 1.6.3. I cannot directly upgrade from 1.2.4 to 1.6.3 rather I have to first upgrade from 1.2.4 to 1.4.2 and then from 1.4.2 to 1.6.3 which is a two way upgrade process. So How could I approach this method with the flash64w.exe utility.

  • August 8, 2017 at 11:20 am

    PreReqs for my script: Enabled PowerShell. Here are the things we’ve enabled: (Win10 1607 Boot Media)

    Is there anything that requires to enable in the Boot Image properties for Windows 10 1703. I cannot find these options in the properties of 1703 boot media.

  • August 24, 2017 at 1:26 pm

    Thanks Gary, this script rocks!!! Nice work! I did run into one issue that I wanted to share for anyone else who may encounter it. If your task sequence deployment is set to 'Access content directly from the distribution point' the script will run but not update the BIOS. The log will show an error 'Unable to locate a BIOS Update Payload'. The problem is with the step to copy the BIOS installer to the root of the package (line 19). Since the content location is on the DP and our network access account does not have write access, the BIOS exe does not copy over. We modified our task sequence deployment to 'Download Content locally when needed by the running task sequence' and the BIOS update is successfully.

  • November 9, 2017 at 8:15 pm

    This has worked wonderfully on past Dells, but the newest Latitudes are giving me an issue. The 5289 and 7389, to be exact. After the update runs, it reboots and actually does the upgrade. When it reboots again, it says "no bootable device found". I checked all of the settings in the BIOS, and when I boot again from my USB drive, I can see the hard drive has all of the files there. And it is definitely formatted as UEFI. But no matter what I do, the image on the drive is no longer bootable.
    I have to go ahead and restart the task sequence completely. It works, of course, because the BIOS is already updated, so it skips that step. Hmm.

    • November 15, 2017 at 4:30 pm

      JP, having the same issues with my 5289's as well as the 7050 desktops. I just started to look at this again to figure out why.

    • December 15, 2017 at 2:07 pm

      Hey JP, found the issue after finding the time to do some testing. From a cohort, he mentioned that it could be the UEFI formatting causing the issue. With this info, I tried the same format and partition task for my UEFI conversion. This task is something quick and dirty nothing special. During this test, it failed and looking at the log, it tells you there isn't enough space on E. I changed the 500mb fat32 partition, to 5GB (no reason why this couldn't be smaller and later when I format the drive before I lay down the OS, it doesn't matter anyway).

      Anyway, this worked for me. However I do my disk prep a little different now per the TS that Gary has provided. I do my disk prep at the beginning of the TS so if it needs a BIOS update, it doesn't format the drive during that group of tasks anymore.

      The issue very well could have been my missteps from the start but I hope this information helps.

  • December 14, 2017 at 8:30 am

    I've searched through this post a dozen times now, and I can't find the download link for the PowerShell script.
    Is it available? Would you point me towards a good link, please?

      • December 14, 2017 at 2:18 pm

        Live Saver! Thank you!
        I would have sworn I hovered over every word in this post, looking for it.
        Thank You!!

  • February 16, 2018 at 11:06 am

    Any chance you can post a NON mdt integrated version of this for import? Or at least publish the steps so I can convert them to a std SCCM task sequence?

    • February 19, 2018 at 5:17 pm

      Ok, Looks like it has all of the steps in the post, however some of them are in the pictures only, I'll try to update this with additional information, and put all of the steps into a nicer "Code" format. Thanks for the feedback.

  • February 22, 2018 at 6:46 am

    Gary, thanks for this usefull post.

    In my environment, I received the error 0x80070002. The log said:

    Failed toexecute command line 'powershell.exe -NoProfile -ExecutionPolicy ByPass -file .\DellBiosUpgradePackage-2.0.ps1' .
    he system cannot find the file specified. (Error: 80070002; Source: Windows)
    Install Software failed to run command line, hr=0x80070002

    How can I test if the problem is powershell component or the missing package?

    What do you recommended to me?

    • February 22, 2018 at 11:43 am

      If you put a "Pause" step in your TS right before that, you can then launch the command prompt, type in PowerShell, which would launch powershell, and you can test to make sure PowerShell is working in your WinPE Boot Image.

  • March 2, 2018 at 7:17 am

    Just thought I'd post my version that uses the script that Robin posted but I've added a bit of regex to extract the version number from the name of the update file being used. That way you don't need to change the file name.
    The regex expression is looking for the text between the second _ and .exe as that is the format all the current update files seem to be using.

    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment -ErrorAction SilentlyContinue
    $tsenv.Value("SMSTS_BiosUpdate") = "True"

    #Create Log Path
    $LogPath = $tsenv.Value("_SMSTSLogPath")

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

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

    #Test path
    $PathExist = Test-Path .\$ComputerModel

    if ($PathExist -eq "True"){
    # Create Bios Variables
    $BiosCurrentVersion = (Get-WmiObject win32_bios).SMBIOSBIOSVersion
    $BiosUpgradeVersion = Get-ChildItem $ComputerModel\*.exe -Verbose | Select -ExpandProperty Name | %{[regex]::match($_, "^(?:[^_]*_){2}(.*?).exe").Groups[1].Value}

    if ($BiosCurrentVersion -lt $BiosUpgradeVersion){
    #Copy Bios Installer to the root of the package - the Flash64W didn't like when I left it in the Computer Model folder, because it has spaces. (Yes, I tried qoutes and stuff)
    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
    $cmds = "/b=$BiosFileName /s /p=$BiosPassword /l=$LogPath\$BiosLogFileName"

    #Update Bios
    $Process = start-process $PSScriptRoot\Flash64W.exe -ArgumentList $cmds -PassThru -wait

    #Creates and Set TS Variable to be used to run additional steps if reboot requried.
    if ($process.ExitCode -eq 2)
    {$tsenv.Value("SMSTS_BiosUpdateRebootRequired") = "True"}
    {$tsenv.Value("SMSTS_BiosUpdateRebootRequired") = "False"}
    if ($process.ExitCode -eq 10)
    {$tsenv.Value("SMSTS_BiosUpdateBatteryCharge") = "True"}
    {$tsenv.Value("SMSTS_BiosUpdateBatteryCharge") = "False"}

  • March 29, 2018 at 7:12 am

    Hi, I try this with an Optiplex 7050 but my TS is skipping everytime with the message: "The task sequence execution engine skipped the group (Dell BIOS Update) because the condition was evaluated to be false."
    The Package should be OK beause its similar to the one who works (Latitude 7280) ok its a Notebook and not a mini PC but it should be the same right? I mean the powershell script...

    Why the TS sequence is skipping the Update Group any idea? The Group conditions is like this:
    select * from Win32_ComputerSystem where Manufacturer = "%Dell%"
    select * from WIN32_BIOS where SMBIOSBIOSVersion < "1.5.8"

    the Optiplex 7050 has a BIOS Version 1.5.2 thats means it should be fine because its less then 1.5.8
    I really dont know why its skipping the TS.


    • April 26, 2018 at 4:25 pm

      select * from Win32_ComputerSystem where Manufacturer = "%Dell%" - Replace = with LIKE
      I never bothered to check BIOS version first, I just have it always run. If the BIOS are already at the same level, it will see it's the same level, and continue on without upgrading. Only adds a little more time to the TS, plus, then you don't have to keep updating your TS Step Logic.

  • April 9, 2018 at 7:07 am

    Very interesting.
    But I have a problem ... to continue after Bios upgrade.
    I put my folder with the two tasks in the "Preinstall" folder after the "Gather local only" task.
    Just before the "New Computer Only" folder.
    The process well start, the BIOS is updated, the computer restart, but it doesn't continue deployment.
    What is wrong ?
    Thank you for your help.


    • June 5, 2018 at 8:54 pm

      What is calling the reboot? The BIOS upgrade, or do you have a reboot computer step? Make sure you disable any reboot via the actual bios upgrade, and handle the reboot from the actual TS.

  • May 1, 2018 at 11:08 am

    hello, did you ever try using the /forcit switch to install the bios even if the battery is low? During a task sequence I typically check if the laptop is plugged in, so even if the battery is <10% it should be ok going forward.

    Curious to know the results and if this switch works on all the bios revisions and from the Flash64w.exe utility


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.