September 23 2010

Remove $NTUninstall and $hf_mig$ folders

There has been a useful article published that outlines how to delete the $NTUninstall and $hf_mig$ folders locally and domain wide to free up space.

The script to run it domain wide is located here –

Check out the post here – –

To do it locally (taken from above post) create a batch file with the following content:

rem // CFG-hotfixfolders.cmd
rem // Removes the KBUninstall folders
attrib -r -h -s -a /S /D "%systemroot%$*"
attrib -r -h -s -a /S /D "%systemroot%$hf_mig$K*"
FOR /D %%K IN (%systemroot%$hf_mig$K*) DO ( reg delete "HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall%%~nxK" /f & ( DEL /f /q "%systemroot%%%~nxK.log" ))
FOR /D %%$ IN (%systemroot%$*) DO rmdir /s /q "%%$"

I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.


Tags: , , ,

Posted September 23, 2010 by danovich in category "Scripting", "Tools", "Windows


  1. By Christoph Voigt on

    While gaining a lot of free space by deleting the $NTUninstall folders, one must always keep in mind that this can have unwanted sideffects.
    Some collegues of mine thought deleting the folders would be a great idea, just to find out that after simply deleting the folders created problems with our implementation of 802.1x on the clients, some clients started reboot-loops and 1 or two even produced nice bluescreens.

    Always test such changes excessively in a lab environment before going productive!

  2. By danovich (Post author) on

    I must say I haven’t seen it cause problems before however as you say, all changes like this must be tested rigorously before being implemented on production machines!

  3. By jf on

    It seems it is OK to only delete the $NTUninstall folders, but NOT OK to delete the $hf_mig$ folder:

    “$hf_mig$ is referenced when future updates are installed.” ( )

    The hf_mig directories are part of the hotfix migration and multibranch support system, so you might need them in the future.

    More about this here:
    Description of Dual-Mode Update Packages for Windows XP ( )


Leave a Reply