How to generate the ‘hotfix directories’ from Microsoft Dynamics NAV

Some of you have missed the so-called "hotfix directories" that have not be part of the monthly updates since Cumulative Update 1 for Microsoft Dynamics NAV 2015 removed. So in November 2014, we wrote here on the blog how to use a Windows PowerShell script that gives you the same folder structure.

It's a best practice for Dynamics NAV, however, to completely reinstall the environment from scratch in order to keep clean and consistent registry key with platform files used.

So this new blog post gives you a flexible script so that you can use the same script for Microsoft Dynamics NAV 2015, 2016, 2017 and 2018.

To use the script

  1. Copy the code below to a local file and save the file as Copy-UpdateFilesToBatchDirectory.ps1.
  2. Unzip the DVD zip file from the Cumulative Update to a local folder.
  3. Run the script.
    1. Open the Microsoft Dynamics NAV Administration Shell as Administrator
    2. Run this command:

     Import-Module DIRECTORY\Copy-UpdateFilesToBatchDirectory.ps1

    where DIRECTORY is the location where you saved the .ps1 file.
    3. Run this command:

     Copy-UpdateFilesToBatchDirectory -DvdDirectory DVDDIRECTORY -Verbose

    where DVDDIRECTORY is the location where you unzipped the DVD from the update,

  4. It should take less than a minute to go through the process, but when done, you should get the same structure as you had before with Microsoft Dynamics NAV 2013 and 2013 R2, located in the same DVD root in a new folder called HOTFIX.

Changes to the script

Changed BatchFolder parameter from Mandatory to Optional.
If not specified, Hotfix (batch) folder will be created automagically inside the DVD folder as a directory called HOTFIX.
Automatic check for Microsoft Dynamics NAV Version
Automatic detection and inclusion for Localized platform files
Detected by the script checking if Installers exists. If it does, it will create a collection of localized version(s) – e.g. with CH you have,, – and runtime copy encoding files (stx, etx) in the appropriate directories
Updated script for Microsoft Dynamics NAV 2017
Updated script for Microsoft Dynamics NAV 2018
The Web Server deployment changed with this major version. These are the two breaking changes:

  1. WEB CLIENT. The files contained in this directory should be copied into Microsoft Dynamics NAV Web Client folder (typically C:\Program Files\Microsoft Dynamics NAV\110\Web Client). Moreover the files contained in the WEB CLIENT\WebPublish should be copied in the Web Server directory(ies) (e.g. C:\inetpub\wwwroot\DynamicsNAV110 where DynamicsNAV110 is the server name).
  2. ModernDev. VSIX file, System and Test APP needs to be updated in the Modern Development environment, if you intend to develop extensions.

WithSound optional switch
Introduced optional parameter for accessibility.

Updated script

Copy-UpdateFilesToBatchDirectory - change the file extension to .ps1


These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

Jorge Alberto Torres (jtorres)
MDCC Lyngby
Service Engineering Team

Duilio Tacconi (dtacconi)
Denmark Microsoft Dynamics – Italy
Microsoft Customer Service and Support (CSS) EMEA

Comments (7)

  1. Pallea says:

    Thanks for the update. Much Appreciated.

    1. dtacconi says:

      Thanks Pallea :-). I found this also more useful than the previous one (e.g. no batch directory to specify, plus it detects automatically major version and localized files)

  2. Gert Lynge says:

    Thanks for the update. I use it all the time. Highly Appreciated.
    I tend to modify it this way (which can inspire for future improvements I guess (may by something you select with a parameter)?
    Instead of deleting .config/.json files I rename them to .config.orig/.json.orig – this eases debugging/manual merge of config files if something was changed. And I can live with the files being added to the various catalogs as I see it as a documentation on how the “out of the box” config-file was…
    Best Regards
    Gert Lynge

  3. dtacconi says:

    Thanks Pallea & Gert.
    Good suggestion. To improve your improvements, I would not use .orig but something like e.g. .origXXX where XXX is the build no. for the original server.exe. In this way you could also keep track of how many updates pass by and from which build you come from :-). I will take this into consideration for the next update.

  4. Marcel says:

    I miss
    Copy-Item $DvdDirectory\”Installers\$LocalizedVersion\WebHelp\DynamicsNAV”$NavVersion”Help”\* -destination $BatchDirectory\_Temp\HelpServer -recurse -Force

  5. Since the Upgradetoolkit directory is missing on some releases (like the current NAV 2015 CU42), the script will then abort with an error message. To avoid this, the line where this is copied must start with a Test-Path like this:
    if (Test-path $DvdDirectory\”UpgradeToolKit”) {Copy-Item $DvdDirectory\”UpgradeToolKit”\* -destination $BatchDirectory\_Temp\UpgradeToolKit -recurse -Force}

  6. I’ve published a PowerShell module and scripts to help automate the deployment of the CU too. You can find the code on GitHub, project name: NavCumulativeUpdateDeployment

Skip to main content